Recommended Posts

Gandi    122
I just don't get it.... I'm using Boost 1.42 with Visual Studio 2008. I successfully built boost with bjam and set up the additional Linker and Include-Directories. Finally, I included the signals.h and linked against the lib using:
#define BOOST_ALL_DYN_LINK
#include &lt;boost/signals.hpp&gt;
#ifdef DEBUG
#pragma comment ( lib, "boost_signals-vc90-mt-gd-1_42.lib" )
#else
#pragma comment ( lib, "boost_signals-vc90-mt-1_42.lib" )
#endif


In my code I just used a simple boost:signal and called it, but I all got was the well-known linker error:
1&gt;main.obj : error LNK2001: Unresolved external symbol



Share on other sites
silvermace    634
I guess there are a few simple things to check:

First, do a complete clean build.

Second, check that BOOST_ALL_DYN_LINK is actually defined somewhere, ideally in the project settings so that it's provided as a command line PP-define.

Thirdly, try removing the #pragma comment(lib) facility and providing the library to link to using the project settings window I think its somewhere under Linker->Additional Dependencies. (As an aside, #pragma-comment-lib is not very portable)