PDA

View Full Version : conflict between boost signals and Qt signals



high_flyer
13th December 2007, 14:51
We had the above problem and could not find on the forum posts that dealt with it, and thought to post the solution in case someone else will for it here.
http://labs.trolltech.com/blogs/2007/06/15/boost-signals-slots-with-qt/

black_coder
26th June 2008, 08:15
This doesn't work for me. I tried the CONFIG += no_keywords which resulted in lots of errors like :

ISO C++ forbids declaration of ‘signals’ with no type
ISO C++ forbids declaration of ‘slots’ with no type

and if I remove the CONFIG += no_keywords I get the following stupid errors :
/usr/include/boost/signals/detail/signals_common.hpp:26: error: expected identifier before ‘protected’
/usr/include/boost/signals/detail/signals_common.hpp:26: error: expected unqualified-id before ‘protected’
.tmp/moc_robotmanager.cpp:81: error: expected `}' at end of input

The only way i can make it work is by including :

#include <boost/signal.hpp>
#include <boost/bind.hpp>


at the top of each header file which really doesn't make any sense !!!
Is there anyway to get rid of this stupid naming clash ??

mcosta
26th June 2008, 09:46
You can use "CONFIG += no_keywords" in .pro file and use Q_SIGNALS and Q_SLOTS instead of "signals" and "slots"