光找了grwin.h估计是不成了,你还得去找有没有grwin.lib或者grwin.dll。

解决方案 »

  1.   

    我找到了grwin.lib不过还是不行啊。不知道是我装错没有?你认为应该装到哪里??
      

  2.   

    vc不是都封装了一套GDI了吗?用这个就行了呀。
      

  3.   

    加在连接库里面后头文件<grwin.h>可以打开了。我先试了一个比较简单的程序如下:
    #include <GrWin.h>
    int main(void)
    {   int width = 640, height = 400;
        GWopen(0);
        GWsize(-5, &width, &height);
        GWsize(-3, NULL, NULL);
        GWvport(0.0, 0.0, (float)width / (float)height, 1.0);
        GWindow(0.0, 0.0, (float)width - 1.0, (float)height - 1.0);
        /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
        GWclear(14);    /* 画面消去 */
        GWline(50.0, 300.0, 150.0, 300.0);    /* 直線、水平 */
        GWline(100.0, 350.0, 100.0, 250.0);   /* 直線、垂直 */
        /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
        GWquit();
        return 0;
    }
    编译已经通过。在连接这步的时候有如下问题:
    999.obj : error LNK2001: unresolved external symbol _GWquit
    999.obj : error LNK2001: unresolved external symbol _GWline
    999.obj : error LNK2001: unresolved external symbol _GWclear
    999.obj : error LNK2001: unresolved external symbol _GWindow
    999.obj : error LNK2001: unresolved external symbol _GWvport
    999.obj : error LNK2001: unresolved external symbol _GWsize
    999.obj : error LNK2001: unresolved external symbol _GWopen
    请各位高手给我看下需要怎么解决,小弟不甚感激!!!
      

  4.   

    你已经把grwin.lib加在连接库里了?
      

  5.   

    我把grwin.lib加到安装VC的时候有的VC98下面的Lib的文件夹里面了。不知道是不是连接库??
      

  6.   

    你找到这个头文件加到工程后,再到工具->选项->目录,里面有包括头文件,把你头文件的地址加到指定位置,或者你新建一个#include文件,把地址加进去也行,你可以试下!
      

  7.   


    在你的cpp中加上如下代码
    #include "grwin.h"
    #pragma comment(lib,"grwin.lib")
    应该就可以了
      

  8.   

     回楼上,我按照你说的做了,程序就改为如下:
    #include <GrWin.h>
    #pragma comment(lib,"grwin.lib") 
    int main(void)
    {
        int width = 640, height = 400;    GWopen(0);
        GWsize(-5, &width, &height);
        GWsize(-3, NULL, NULL);
        GWvport(0.0, 0.0, (float)width / (float)height, 1.0);
        GWindow(0.0, 0.0, (float)width - 1.0, (float)height - 1.0);
        /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
        GWclear(14);    /* 画面消去 */
        GWline(50.0, 300.0, 150.0, 300.0);    /* 直線、水平 */
        GWline(100.0, 350.0, 100.0, 250.0);   /* 直線、垂直 */
        /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
        GWquit();
        return 0;
    }
    不过错误为:
    Linking...
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
    LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
    Debug/999.exe : fatal error LNK1169: one or more multiply defined symbols found
    执行 link.exe 时出错.
    我不知道应该怎么解决。请各位给予指导。