error LNK2005 与 error LNK2019

HELLO_wallace 2009-03-22 11:10:38
我在我的工程中引入了两个库,当引入第二个库的时候出现了error LNK2005 与 error LNK2019同时出现的情况
RUNTIME LIB 是Multi-threaded Debug (/MTd),后来我将这三个工程的runtime lib都设置成那个之后,引入的那两个库改变后都经过了重新编译,引入的位置都没问题,但问题依旧。
后来我不管将runtime lib设置成什么值,结果都会出现这两个错误,而且有的时候错误内容不一样。

请大家分析帮忙。

说明:只有引入第二个库的时候会出现那种问题。
...全文
135 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
HELLO_wallace 2009-03-23
  • 打赏
  • 举报
回复
再提供一点信息,是这样的,我下载了Sockets库,然后编译,发现他需要openssl的头文件,然后下载了openssl库,将Sockets作为工程加入我的solution ,之后编译该工程,OK
在我的MAIN工程中,我链接Sockets.lib,之后最后定位到这里错误
error LNK2019: unresolved external symbol _SSL_free referenced in function "public: virtual __thiscall TcpSocket::~TcpSocket(void)" (??1TcpSocket@@UAE@XZ)

好像是openssl的问题: _SSL_free ,openssl里没有工程文件,没法编译。
谁知道怎么回事呢?
HELLO_wallace 2009-03-23
  • 打赏
  • 举报
回复
http://blog.csdn.net/sunyujia/archive/2008/10/03/3014667.aspx
原来是openssl没装,晕,好麻烦
Cpp权哥 2009-03-22
  • 打赏
  • 举报
回复
Linker Tools Error LNK1169(2019?)
one or more multiply defined symbols found

The build failed due to multiple definitions of one or more symbols. This error is preceded by error LNK2005.

The /FORCE or /FORCE:MULTIPLE option overrides this error.
Cpp权哥 2009-03-22
  • 打赏
  • 举报
回复
Linker Tools Error LNK2005
symbol already defined in object

The given symbol, displayed in its decorated form, was multiply defined.

Tips

One of the following may be a cause:

The most common cause of this error is accidentally linking with both the single-threaded and multithreaded libraries. Ensure that the application project file includes only the appropriate libraries and that any third-party libraries have appropriately created single-threaded or multithreaded versions.


The given symbol was a packaged function (created by compiling with /Gy) and was included in more than one file but was changed between compilations. Recompile all files that include the symbol.


The given symbol was defined differently in two member objects in different libraries, and both member objects were used.


An absolute was defined twice, with a different value in each definition.
  • 打赏
  • 举报
回复
http://zhidao.baidu.com/question/20263216.html
error LNK2019
http://hi.baidu.com/fx0517/blog/item/d096a264866d3ef5f73654c6.html   
LNK2005

64,642

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧