   Problem using boost::signals
  I'm currently trying to use boost signals for my game project.I can get it compiling without a problem, and linking also works, but it keeps giving me runtime errors.After a while I tried to build the hello word example, but it gives me the same run-time error. The error happens at sig.connect(hello); (from the tutorial).I guess it is some kind of linking error, but I can't really figure it out.I'm using MSVC2008 beta 2, and I'm linking against the libs provided with the boost installer. I've tried quite a few different .lib files now. Any ideas?This is the error,Quote:Microsoft Visual Studio C Runtime Library has detected a fatal error in game.exe.Press Break to debug the program or Continue to terminate the program.and in debug it sends me to line 110 in slot.hpp when the runtime error happenstemplate<typename F>    slot(const F& f) : slot_function(BOOST_SIGNALS_NAMESPACE::get_invocable_slot(f, BOOST_SIGNALS_NAMESPACE::tag_type(f)))    { this->data.reset(new data_t); // Visit each of the bound objects and store them for later use // An exception thrown here will allow the basic_connection to be // destroyed when this goes out of scope, and no other connections // have been made. BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor    do_bind(this->data->bound_objects); visit_each(do_bind,   BOOST_SIGNALS_NAMESPACE::get_inspectable_slot    (f, BOOST_SIGNALS_NAMESPACE::tag_type(f))); create_connection();    }
  If you can't get any of the lib files to work, you might want to try adding the boost::signal source files directly to your project. First go to boost/config/user.hpp and uncomment the BOOST_ALL_NO_LIB line or add a #define BOOST_SIGNALS_NO_LIB. Then add the source files in boost/libs/signals/src to your project. You may want to put them into a new folder.   ;  That works just brilliantly. Thank you, SiCrane.   ;  I have now entered a new problem: I can't call disconnect on my boost::signal<void ()> with a const boost::function<void ()>&. The error message is error C2666: 'boost::operator ==' : 4 overloads have similar conversions. How would I go about disconnecting a slot from the signal?It doesn't work with const boost::signal<void()>::slot_type& either. ;  When you call connect() to a signal, the return value is a connection object. When you want to disconnect, call disconnect() on that connection object.   ;  I know that is possible. I wanted to do it the other way around, so that I do not have to store a variable explicitly. I read the documentations quite thoroughly before asking and it has this source:void foo();void bar();signal<void()> sig;sig.connect(&foo);sig.connect(&bar);// disconnects foo, but not barsig.disconnect(&foo);So I figured that I could use a boost::bind for this, it just does not seem to work. Do I have to use a returned connection object for this?   ;  In order to disconnect with a slot, the slot needs to be equality comparable. Function pointers are, but boost::function<> is not equality comparable.   ;  Thank you for the information. It makes sense. Is there a way I could have obtained this info by myself, so that I don't have to pollute the forums in the future? I have looked in the docs, but I might do it wrong. ;  In this case, the boost::signals documentation says that the == needs to be publicly accessible and boost::function documentation says that boost::function isn't equality comparable. I really don't know what to tell you other than to read the documentation carefully.   