Bug #419

RSB clashes with Qt

Added by M. Rolf almost 13 years ago. Updated over 12 years ago.

Status:ResolvedStart date:07/14/2011
Priority:NormalDue date:
Assignee:J. Wienke% Done:

100%

Category:C++
Target version:0.4

Description

The following program does not compile:

#include <qapplication.h>
#include <rsb/Informer.h>
int main(){
    return 0;
}

In file included from /vol/xcf/include/rsb/transport/Factory.h:31,
                 from /vol/xcf/include/rsb/Informer.h:33,
                 from application/test.cpp:3:
/vol/xcf/include/rsb/transport/InPullConnector.h:48: error: declaration of ‘virtual int rsb::transport::InPullConnector::EventPtr(bool)’
/vol/xcf/include/rsb/Event.h:138: error: changes meaning of ‘EventPtr’ from ‘typedef class boost::shared_ptr<rsb::Event> rsb::EventPtr’


Related issues

Blocked by Robotics Systems Commons - Enhancement #557: name clashes with Qt Resolved 09/08/2011

Associated revisions

Revision b6f9534f
Added by J. Wienke over 12 years ago

Avoid name clashes with Qt emit. This changes the API!

refs #557
refs #419

Revision 9ba51b46
Added by J. Wienke over 12 years ago

merge back r2550 to branch to avoid Qt name clashes.

fixes #419

History

#1 Updated by J. Moringen almost 13 years ago

  • Status changed from New to Resolved

This seems to be broken in QT: from what I understand, QT defines some macros (emit in this case) which get leaked into other header files causing arbitrary expansions.

There seem to be two workarounds:

  • Reversing the order of #include statements such that QT-related headers are last
  • Defining QT_NO_KEYWORDS

#2 Updated by J. Moringen almost 13 years ago

  • Status changed from Resolved to Feedback

#3 Updated by M. Rolf almost 13 years ago

Reversing include-order works.
However, Qt is quite widely used, so it would be nice to avoid names like signal/slot/emit in RSB.

#4 Updated by J. Wienke over 12 years ago

  • Status changed from Feedback to In Progress
  • Assignee set to J. Wienke
  • Target version set to 0.4

#5 Updated by J. Wienke over 12 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset r2551.

Also available in: Atom PDF