?求助各位关于一个VC画图方面的问题。急!!!! 光找了grwin.h估计是不成了,你还得去找有没有grwin.lib或者grwin.dll。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我找到了grwin.lib不过还是不行啊。不知道是我装错没有?你认为应该装到哪里?? vc不是都封装了一套GDI了吗?用这个就行了呀。 加在连接库里面后头文件<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 _GWquit999.obj : error LNK2001: unresolved external symbol _GWline999.obj : error LNK2001: unresolved external symbol _GWclear999.obj : error LNK2001: unresolved external symbol _GWindow999.obj : error LNK2001: unresolved external symbol _GWvport999.obj : error LNK2001: unresolved external symbol _GWsize999.obj : error LNK2001: unresolved external symbol _GWopen请各位高手给我看下需要怎么解决,小弟不甚感激!!! 你已经把grwin.lib加在连接库里了? 我把grwin.lib加到安装VC的时候有的VC98下面的Lib的文件夹里面了。不知道是不是连接库?? 你找到这个头文件加到工程后,再到工具->选项->目录,里面有包括头文件,把你头文件的地址加到指定位置,或者你新建一个#include文件,把地址加进去也行,你可以试下! 在你的cpp中加上如下代码#include "grwin.h"#pragma comment(lib,"grwin.lib")应该就可以了 回楼上,我按照你说的做了,程序就改为如下:#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:libraryDebug/999.exe : fatal error LNK1169: one or more multiply defined symbols found执行 link.exe 时出错.我不知道应该怎么解决。请各位给予指导。 GetActiveDocument和GetDocument的区别 matlab混合编程如何使用mxArray ** 如何使用boost/regex正则库提取输入串中的某个部分 VC里如何调用VB的程序 请问在VC中,怎样区分新添加的函数添加到哪些类中?如cview,cMainFrm等类? 如何把RGB颜色转换为一个字节? 使用TAPI如何确定收到的呼叫是语音呼叫还是Modem拨号呼叫? 孙鑫的代码VC++6.0运行良好,到vs2010就出错 请问setAudio怎么用啊 以下语句错在哪里? 为什么DIRECTDRAW中创建委托内存页面不成功 CString十六进制转CString十进制
#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
请各位高手给我看下需要怎么解决,小弟不甚感激!!!
在你的cpp中加上如下代码
#include "grwin.h"
#pragma comment(lib,"grwin.lib")
应该就可以了
#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 时出错.
我不知道应该怎么解决。请各位给予指导。