2010-05-04 52 views
2

我正尝试在Visual Studio 2005上使用多个项目。我有一个项目依赖于另外两个项目。我在第一个项目解决方案中包含了这两个项目,并正确设置了依赖关系。当在Visual Studio 2005中包含其他项目时链接错误(LNK2019)

我链接项目时出现此错误:

1>server_controller.obj : error LNK2019: unresolved external symbol "public: __thiscall server_communication::TcpServer::TcpServer(class boost::asio::io_service &,struct server_communication::ServerParameters &)" ([email protected][email protected]@[email protected][email protected]@[email protected]@[email protected]@@Z) referenced in function "public: __thiscall server_controller::ServerController::ServerController(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" ([email protected][email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 

我看来,这些符号不能在其他项目中发现,即使在这些项目中定义。

回答

-1

你是如何设置依赖关系的?在C++中,您需要在Project - Properties - Linker - Additional libraries中设置链接器依赖项。在这里添加所需的.lib文件。

关于解决方案依赖关系对话框:它只影响项目构建顺序,但不解决链接器依赖关系。

+0

我不得不将子项目构建为静态库,并将这些库的文件夹包含到链接器附加库中。这工作,非常感谢。 – Arthur 2010-05-04 10:20:00

+0

-1表示不准确。项目依赖项默认DO会自动包含.libs。这可以通过项目设置来抑制,但默认情况下启用。 – 2010-05-04 10:39:19

相关问题