Problem 911

Summary: Error during compilation of OpenInventor file: SoBox.cc
Product: Geant4 Reporter: korsch
Component: visualization/OpenInventorAssignee: barrand
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.1   
Hardware: PC   
OS: Linux   

Description korsch 2006-11-27 13:07:19 CET
I try to compile the openinventor support for Geant4 using gcc version 4.1.1
20061011. The compilation terminates with the error:

 Compiling SoBox.cc ...
src/SoBox.cc:59: error: extra ;
make: *** [/usr/local/cern/geant/geant4/tmp/Linux-g++/G4OpenInventor/SoBox.o]
Error 1

It seems that a similar (same?) problem has occured using gcc 3.4.x. The problem
seemed to be a compilation with a "pedantic" flag. I can't find any reference
to "pedantic" in any of the relevant makefiles.

I have the following Inventor packages installed:

Inventor-devel-2.1.5-24.fc6
Inventor-demos-2.1.5-24.fc6
Inventor-data-2.1.5-24.fc6
Inventor-2.1.5-24.fc6
InventorXt-2.1.5-24.fc6
Inventor-examples-2.1.5-24.fc6
InventorXt-devel-2.1.5-24.fc6

Any help is highly appreciated.

Thanks,
 W. Korsch
Comment 1 barrand 2006-11-29 01:25:59 CET
Hello

  With the g++-3.<something>, the compiler stopped on an empty statement ";;"
with the -pedantic option ; which was a little bit too much (nothing refrain to
have an empty statement in the C++ standard). But this seems ok with the
g++-4.0.1 on my Mac. Then can you try to compile the simple below code :

    int main() {
       int i;;
       return 0;
    }

 Can you try by capturing the options used by Geant4 ?

 The line pointed in SoBox.cc is a big cpp macro, then not easy to see
what is exactly the context from which the extra ';' comes....

 Anyway, I have not tried the Inventor-2.1.5 with a g++-4.x. I am going to have
a try... In general I am using coin3d-2.x for the Inventor implementation.
You may think also to try it...

  Cheers
Comment 2 barrand 2006-11-29 02:00:59 CET
Hello

  Then it seems that g++-4.x with -pedantic stops on something like :
     void xxx() {};
 that is to say with an extra ";" after the declaration of a function.

  To go on, I propose that you compile the Inventor drivert without the
-pedantic opition. It is set in the config/sys/Linux-g++.gmk.

    Cheers