views:

83

answers:

1

I am trying to work with several projects on visual studio 2005. I have one project that depends on two others. I have included those two project in the first project solution, and set the dependencies correctly.

I get this error when linking the project:

1>server_controller.obj : error LNK2019: unresolved external symbol "public: __thiscall server_communication::TcpServer::TcpServer(class boost::asio::io_service &,struct server_communication::ServerParameters &)" (??0TcpServer@server_communication@@QAE@AAVio_service@asio@boost@@AAUServerParameters@1@@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> >)" (??0ServerController@server_controller@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z)

I seems that the symbols can not be found in the other projects, even though there are defined in those projects.

A: 

How did you set dependencies? In C++ you need to set linker dependencies in Project - Properties - Linker - Additional libraries. Add required .lib files here.

About solution Dependencies dialog: it only affects projects build order, but doesn't resolve linker dependencies.

Alex Farber
I had to build the sub-project as static libraries and include the folders of those libraries to the linker additional libraries. This is working, thanks a lot.
jules
-1 for being inaccurate. Project dependencies by default DO cause the automatic inclusion of .libs. This can be suppressed with a project setting, but by default its enabled.
Chris Becke