当前位置: 技术问答>linux和unix
error LNK2001: unresolved external symbol 求助
来源: 互联网 发布时间:2016-12-01
本文导语: 编译时出现错误如下,可能是什么原因?我用的vs2008编译的。库明明引用了,但还报错. 1>libprotobuf.lib(message.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orpha...
编译时出现错误如下,可能是什么原因?我用的vs2008编译的。库明明引用了,但还报错.
1>libprotobuf.lib(message.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>libprotobuf.lib(strutil.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>libprotobuf.lib(message.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
1>libprotobuf.lib(strutil.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
|
windows 平台?
|
表示 这些符号找不到
情况一:那些函数所在的文件没有编译进来。。。
情况二:那些函数所在的库没有连接进来。。。
一般都是这两种情况
情况一:那些函数所在的文件没有编译进来。。。
情况二:那些函数所在的库没有连接进来。。。
一般都是这两种情况
|
到各个系统自身的include目录里 用 grep "__declspec" 目录 -R 去看看到底是哪个字符串没定义。找到没定义的字符串,到网上去查这个字符串包含在什么.h文件里,就知道到底是什么原因造成的了。
|
还有一种可能 c++ 和c 相互调用的时候 头文件定义没有加
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。