Compilation problem with gcc-4.0.3

Hello,

I am trying to build OpenCascade 6.1 on an x86 Gentoo box with gcc-4.0.3. I got the following compilation error:

i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I/usr/include/stlport -I../../../inc -I../../../drv/DBC -I../../../src/DBC -I../../../drv/PCollection -I../../../src/PCollection -I../../../drv/PColStd -I../../../src/PColStd -I../../../drv/PMMgt -I../../../src/PMMgt -I../../../drv/PShort -I../../../src/PShort -I../../../drv/PStandard -I../../../src/PStandard -I../../../drv/PTColStd -I../../../src/PTColStd -I../../../drv/ObjMgt -I../../../src/ObjMgt -I/usr/include/stlport -DNDEBUG -DNo_Exception -O2 -MT DBC_VArrayNodeOfVArrayOfCharacter_0.lo -MD -MP -MF .deps/DBC_VArrayNodeOfVArrayOfCharacter_0.Tpo -c ../../../drv/DBC/DBC_VArrayNodeOfVArrayOfCharacter_0.cxx -fPIC -DPIC -o .libs/DBC_VArrayNodeOfVArrayOfCharacter_0.o
i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I/usr/include/stlport -I../../../inc -I../../../drv/DBC -I../../../src/DBC -I../../../drv/PCollection -I../../../src/PCollection -I../../../drv/PColStd -I../../../src/PColStd -I../../../drv/PMMgt -I../../../src/PMMgt -I../../../drv/PShort -I../../../src/PShort -I../../../drv/PStandard -I../../../src/PStandard -I../../../drv/PTColStd -I../../../src/PTColStd -I../../../drv/ObjMgt -I../../../src/ObjMgt -I/usr/include/stlport -DNDEBUG -DNo_Exception -O2 -MT DBC_VArrayNodeOfVArrayOfInteger_0.lo -MD -MP -MF .deps/DBC_VArrayNodeOfVArrayOfInteger_0.Tpo -c ../../../drv/DBC/DBC_VArrayNodeOfVArrayOfInteger_0.cxx -fPIC -DPIC -o .libs/DBC_VArrayNodeOfVArrayOfInteger_0.o
../../../inc/DBC_BaseArray.hxx:107: error: 'DBC_DBVArray' does not name a type
../../../inc/DBC_BaseArray.hxx:108: error: expected ',' or '...' before 'p'
../../../inc/DBC_BaseArray.hxx:108: error: ISO C++ forbids declaration of 'DBC_DBVArray' with no type
../../../inc/DBC_BaseArray.hxx:126: error: 'DBC_DBVArray' does not name a type
../../../inc/DBC_BaseArray.hxx: In member function 'void DBC_BaseArray::_CSFDB_SetDBC_BaseArraymyData(int)':
../../../inc/DBC_BaseArray.hxx:108: error: 'myData' was not declared in this scope
../../../inc/DBC_BaseArray.hxx:108: error: 'p' was not declared in this scope
make[3]: *** [DBC_VArrayNodeOfVArrayOfCharacter_0.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
../../../inc/DBC_BaseArray.hxx:107: error: 'DBC_DBVArray' does not name a type
../../../inc/DBC_BaseArray.hxx:108: error: expected ',' or '...' before 'p'
../../../inc/DBC_BaseArray.hxx:108: error: ISO C++ forbids declaration of 'DBC_DBVArray' with no type
../../../inc/DBC_BaseArray.hxx:126: error: 'DBC_DBVArray' does not name a type
../../../inc/DBC_BaseArray.hxx: In member function 'void DBC_BaseArray::_CSFDB_SetDBC_BaseArraymyData(int)':
../../../inc/DBC_BaseArray.hxx:108: error: 'myData' was not declared in this scope
../../../inc/DBC_BaseArray.hxx:108: error: 'p' was not declared in this scope
make[3]: *** [DBC_VArrayNodeOfVArrayOfExtCharacter_0.lo] Error 1
../../../inc/DBC_BaseArray.hxx:107: error: 'DBC_DBVArray' does not name a type
../../../inc/DBC_BaseArray.hxx:108: error: expected ',' or '...' before 'p'
../../../inc/DBC_BaseArray.hxx:108: error: ISO C++ forbids declaration of 'DBC_DBVArray' with no type
../../../inc/DBC_BaseArray.hxx:126: error: 'DBC_DBVArray' does not name a type
../../../inc/DBC_BaseArray.hxx: In member function 'void DBC_BaseArray::_CSFDB_SetDBC_BaseArraymyData(int)':
../../../inc/DBC_BaseArray.hxx:108: error: 'myData' was not declared in this scope
../../../inc/DBC_BaseArray.hxx:108: error: 'p' was not declared in this scope
make[3]: *** [DBC_VArrayNodeOfVArrayOfInteger_0.lo] Error 1
make[3]: Leaving directory `/var/tmp/portage/opencascade-6.1/work/opencascade-6.1/ros/adm/make/PTKernel'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/opencascade-6.1/work/opencascade-6.1/ros/adm/make'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/opencascade-6.1/work/opencascade-6.1/ros'
make: *** [all] Error 2

Is there any patch to solve the problem?

Daniel

Bearloga's picture

Hi Daniel,
I think the problem is that the preprocessor variable CSFDB is not defined.
Regards

Tourde's picture

Hello,

Thanks for your answer.
How and where this variable should be defined? Do you know?

Daniel

Bearloga's picture

It is defined in make procedures coming with OCC. E.g., here are the lines from configure.in file:

dnl Make sure CSFDB is defined in CXXFLAGS and CFLAGS
CXXFLAGS="$CXXFLAGS -DCSFDB -DNO_CXX_EXCEPTION"
CFLAGS="$CFLAGS -DCSFDB -DNO_CXX_EXCEPTION"

Tourde's picture

Hello,

Thanks for the information. I will try this tonight when I am back home.
BTW, I got also compiling issues when I was using gcc-4.1.1:
http://www.opencascade.org/org/forum/thread_10015/

Do you know where I can report it? (Some bugzilla or something). Do you happen to know if there are some patches available to build OC6.1 with gcc 4.1.x?

Thanks in advance for any answer.

Daniel

Tourde's picture

CFLAGS is OK but CXXFLAGS seems not OK.

When I check opencascade-6.1/ros/Makefile I get:
CFLAGS = -march=prescott -mfpmath=sse -Os -pipe -DCSFDB -DNO_CXX_EXCEPTION -DLIN -DLININTEL -DNDEBUG -DNo_Exception -O2
CXXFLAGS = -I/usr/include/stlport -DNDEBUG -DNo_Exception -O2

How am I suppose to correct things in a clean and efficient way?

Daniel

Tourde's picture

Hello,

I found it... It was as a matter of fact, the classical 'holy trilogy'...

aclocal
autoheader
automake
libtoolize
autoconf

This fixed all the flags mentionned in this thread.

Daniel