Sign in to follow this  
Gandi

Linker Error with boost signals

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 <boost/signals.hpp>
#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>main.obj : error LNK2001: Unresolved external symbol 
""__declspec(dllimport) public: __thiscall boost::signals::detail::call_notification::call_notification(class boost::ptr<class boost::signals::detail::signal_base_impl> const &)" (__imp_??0call_notification@detail@(etc. etc.))".

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this