Question

I am trying to compile my project with OSG and I installed all the necessary rpms for it in OpenSUSE 12.1. I'm not sure what is going on because all I did was #include and my compiler (gcc 4.6.2) crashes inside of it saying:

'expected identifier before '(' token'

The problem is when I click on the error, where it brings me to in the FileUtils is

enum Value {

OK,

SOURCE_EQUALS_DESTINATION,

... and so on

};

I don't understand what is going on and would greatly appreciate any help.

Was it helpful?

Solution

Clearly it is a syntax error somewhere, since the preprocessor came across something unexpected. The little snippet you posted already has one: you should have a semicolon after the ending brace of the enum (enum Value { ... };).

OTHER TIPS

Sometimes I get weird interactions if I am using multiple APIs and one #defines its constants instead of using nicely namespaced enumerations like OSG does. Maybe something you include before FileUtils is #define-ing "OK" or "Value", these are the most generic I can see in the lines that give you errors. Try #undef OK and #undef Value before your include, or otherwise avoid using preprocessor commands for constants.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top