Support #1298

RSB and openCV: compile success depends on order of includes

Added by C. Emmerich over 11 years ago. Updated over 11 years ago.

Status:RejectedStart date:12/13/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

When including rsb-headers and openCV-headers in a project the succuess of compilation depends on the ordering of the includes.

The following works ...

#include <rsb/Factory.h>
#include <cv.h>

int main ( int argc, char **argv ) {
 // stuff
 return 0;
}

... whereas switching the include order to

#include <cv.h>
#include <rsb/Factory.h>

results in a compile error:

[ 57%] Building CXX object FlexIRobPerceptionChain/CMakeFiles/FlexIRobPerceptionChain.dir/main.cpp.o
In file included from /vol/flexirob/releases/trunk/include/rsb/Factory.h:41,                                                                                                                 
                 from /homes/cemmeric/flexirob_workspace/Perception/FlexIRobPerceptionChain/main.cpp:23:
/vol/flexirob/releases/trunk/include/rsb/ParticipantConfig.h:217: error: expected identifier before ‘goto’
/vol/flexirob/releases/trunk/include/rsb/ParticipantConfig.h:217: error: expected ‘}’ before ‘goto’
/vol/flexirob/releases/trunk/include/rsb/ParticipantConfig.h:217: error: expected unqualified-id before ‘goto’
/vol/flexirob/releases/trunk/include/rsb/ParticipantConfig.h:224: error: expected unqualified-id before ‘)’ token
/vol/flexirob/releases/trunk/include/rsb/ParticipantConfig.h:225: error: declaration of ‘~rsb::ParticipantConfig’ as non-member
/vol/flexirob/releases/trunk/include/rsb/ParticipantConfig.h:232: error: non-member function ‘rsb::QualityOfServiceSpec rsb::getQualityOfServiceSpec()’ cannot have cv-qualifier
/vol/flexirob/releases/trunk/include/rsb/ParticipantConfig.h:253: error: ‘ErrorStrategy’ does not name a type
...

Is this a bug in rsb? Or in openCV? Can that be fixed somehow?


Related issues

Duplicates Robotics Service Bus - Bug #1175: OpenCV preprocessor symbol collides with ParticipantConfi... Resolved 09/28/2012

History

#1 Updated by J. Moringen over 11 years ago

This is most likely a bug in OpenCV which probably contains code along the lines

#define EXIT goto bla bla

If Robotics Service Bus header are included after this definition, the token EXIT in the Robotics Service Bus code expands to goto bla bla, which does not make sense.

This could be fixed by renaming EXIT to something in Robotics Service Bus. But where should we stop? Upstream libraries could define a macro on any name.

#2 Updated by J. Wienke over 11 years ago

  • Status changed from New to Rejected

This is actually a duplicate of #1175.

Also available in: Atom PDF