Sign in to follow this  

Linker Error with boost signals

This topic is 2838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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

This topic is 2838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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