读书人

NeHe的代码没有有关问题但是lib老是

发布时间: 2012-02-15 12:09:44 作者: rapoo

NeHe的代码没有问题,但是lib老是连接错误,请教高手,请教高手,请教高手,请教高手,请教高手,请教高手,请教高手,请教高手!


工程:VC 2005 控制台
问题:编译无误,连接出现问题

C/C++ code
1>LIBCMT.lib(crt0.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用1>NeheSDK.lib(opengl.obj) : error LNK2019: 无法解析的外部符号 "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ),该符号在函数 "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) 中被引用1>NeheSDK.lib(state.obj) : error LNK2001: 无法解析的外部符号 "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)1>NeheSDK.lib(nexception.obj) : error LNK2001: 无法解析的外部符号 "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)1>NeheSDK.lib(opengl.obj) : error LNK2019: 无法解析的外部符号 "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ),该符号在函数 "protected: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z) 中被引用1>NeheSDK.lib(state.obj) : error LNK2001: 无法解析的外部符号 "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)1>NeheSDK.lib(nexception.obj) : error LNK2001: 无法解析的外部符号 "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)


请教高手

[解决办法]
恩,应该用win api应用程序要做,不是控制台
[解决办法]
探讨
以前用的VC6,
在Project Options里面把winmm.lib的subsystem: console改为windows
或加上
#pragma comment(linker,"/subsystem:windows")
试试

读书人网 >网络游戏

热点推荐