初学c++ 错误记录:error LNK2001: unresolved external symbol
刚使用vc6.0编译的时候报错,然后一看是没有加上*.lib,而且需要注意debug和release两个版本的路径问题!参考下面列出的第四点把问题解决了,记录一下! 使用前,先要进行如下设置:添加/GR编译选项 Enable C++ RTTI。添加ice的include、StlPort的include、ice的lib路径,并将这些路径提到最前,以免与VC的冲突。为Link Object
刚使用vc6.0编译的时候报错,然后一看是没有加上*.lib,而且需要注意debug和release两个版本的路径问题!参考下面列出的第四点把问题解决了,记录一下!
使用前,先要进行如下设置:
添加/GR编译选项 Enable C++ RTTI。
添加ice的include、StlPort的include、ice的lib路径,并将这些路径提到最前,以免与VC的冲突。
为Link Object/Library modles 加上iced.lib iceutild.lib 。
1、编译中出现
Linking
LINK : fatal error LNK1104: cannot open file "stlport_vc6_static.lib"
Error executing link.exe.
解决办法:
Porject->Setting->C++->CodeGeneration 设置Use Run-time library=Debug Multithreaded DLL
2、编译中出现
warning C4005: '_STLP_DEBUG_CHECK' : macro redefinition
解决办法:在包含ice/ice.h之前添加以下代码
#if !defined(NDEBUG) && !defined(_STLP_DEBUG)
# define _STLP_DEBUG
#endif
3、编译中出现
error C2065: 'TryEnterCriticalSection' : undeclared identifier
解决办法:
在stdafx.h中,加上
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x400
#endif
4、编译中出现
error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceUtil::GCRecMutexInit::GCRecMutexInit(void)" (__imp_??0GCRecMutexInit@IceUtil@@QAE@XZ)
error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceUtil::GCRecMutexInit::~GCRecMutexInit(void)" (__imp_??1GCRecMutexInit@IceUtil@@QAE@XZ)
D
解决办法:
Porject->Setting->Link-> Object/Library modles:加上iced.lib iceutild.lib
5、编译中出现
error C2061: syntax error : identifier 'SC_HANDLE'
error C2061: syntax error : identifier 'SERVICE_STATUS'
error C2146: syntax error : missing ';' before identifier '_statusHandle'
error C2501: 'SERVICE_STATUS_HANDLE' : missing storage-class or type specifiers
error C2501: '_statusHandle' : missing storage-class or type specifiers
error C2146: syntax error : missing ';' before identifier '_status'
error C2501: 'SERVICE_STATUS' : missing storage-class or type specifiers
error C2501: '_status' : missing storage-class or type specifiers
解决办法:
在stdafx.h或其他文件中增加
#include <WINSVC.H>
( http://www.cnitblog.com/lizhenbao/ ),转载请注明出处
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)