Skip to main content
GameDev.net gamedev.net
🔒 Locked

Linking Boost::Signals

Started by JimPrice Mar 17, 2005 at 1:40 PM 2 replies 850+ views
Original Post
JimPrice
JimPrice
After some recent reading, I decided to try out boost::signals. Unfortunately, Mr Dumb-ass, is having problems getting it to work. The relevant text from the boost page is: On Windows, with Microsoft Visual C++ or Borland C++, the linking process is nearly automatic. As with the Regex library, the libraries in libs\signals\build\bin-stage will have mangled names and will be automatically be including in the link process. To link against the Signals library binary dynamically (e.g., using the Signals DLL), define BOOST_SIGNALS_DYN_LINK when building your application; to link statically, define BOOST_SIGNALS_STATIC_LINK. (For note : I am a Windows user, working with VS2003). Oh goody, thought I - my wonderful windows will handle all the linking, all I need to do is add a define. Hence, my code became:

#define BOOST_SIGNALS_STATIC_LINK
#include <boost/signals.hpp>

int main()
{
	return 0;
}

which I assumed, given the text from the boost website above, would be enough. Error message is: Console Experimentation fatal error LNK1104: cannot open file 'libboost_signals-vc71-sgd-1_32.lib' which isn't surprising, because in my boost/lib directory I have: boost-signals-vc71-mt-1_32.dll boost-signals-vc71-mt-1_32.lib boost-signals-vc71-mt.lib boost-signals-vc71-mt-gd-1_32.dll boost-signals-vc71-mt-gd-1_32.lib boost-signals-vc71-mt-gd.lib That is, I neither have the directory libs\signals\build\bin-stage referenced in the boost text, nor the requested file. What's going on? Any suggestions? Some ideas: Am I misreading some instructions? Do I have to build some extra stuff to use signals, as it appears you have to do with boost::regex? Do I need to pragma something in? Am I a dumb-ass? Thanks for any help! Jim.
jdhardy
jdhardy
I've found boost's autolinking to be problematic at best, so I just set the necessary libs in the linker options and let the compiler deal with it.

Looking at the errors, the autolinker wants to add the single-threaded library, but when building boost only the multithreaded libs were built. I would say, either build the single-threaded boost libs, or get the autolinker to use the multi-threaded libs. I'm not sure how, since I only have VS2005, and it no longer has the ST CRT.
smart_idiot
smart_idiot
Does mt mean multi-threading? Are there any thread related options you should compile with?
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
JimPrice
JimPrice
Thanks both - the multi-tasking switch does appear to be my downfall.

Still getting some issues, but I think I'm in a better position to understand these.

Jim.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.