我正在开发聊天服务器(名称是PengChat),它是主要的源代码。
(CServerSocket.h
包括boost/asio.hpp
),并且有两个错误。
1>main.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ)
1>main.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ)
我的环境是
/MT
)(在发布中)你知道这些错误吗?
请帮帮我。
感谢。
PS。在调试模式下(使用/MTd
选项)。它汇编得很好。但在发布模式下(使用/MT
选项),有两个错误。
PS2。我不能用 Ctrl + K ,这很奇怪;请看评论窗口
编辑
申请的源代码如下:
#include <stdio.h>
#include <memory>
#include "../PengChatServerLib/CServerSocket.h"
#ifdef _MSC_VER
#ifdef _DEBUG
#pragma comment(lib, "../Debug/PengChatServerLib")
#else
#pragma comment(lib, "../Release/PengChatServerLib")
#endif
#endif
int main()
{
boost::asio::io_service iosrv;
std::unique_ptr<PengChat::CServerSocket> pSock(new PengChat::CServerSocket(iosrv, 8888));
getchar();
pSock.reset();
return 0;
}