Mon, 08/30/2004 - 13:25
Hi,
I get the following compilation error after installing OCC5.2 on Linux.
In file included from /usr/local/CAS5.2/inc/gp.hxx:26,
from incad/algos/convert/CasConvert.cpp:17:
/usr/local/CAS5.2/inc/Standard_Real.hxx: In function `Standard_Integer RealSize ()':
/usr/local/CAS5.2/inc/Standard_Real.hxx:162: `CHAR_BIT' undeclared (first use this function)
/usr/local/CAS5.2/inc/Standard_Real.hxx:162: (Each undeclared identifier is reported only once for each function it appears in.)
In file included from /usr/local/CAS5.2/inc/Standard_Address.hxx:20,
from /usr/local/CAS5.2/inc/Standard.hxx:28,
from /usr/local/CAS5.2/inc/gp.hxx:72,
from incad/algos/convert/CasConvert.cpp:17:
/usr/local/CAS5.2/inc/Standard_Integer.hxx: In function `Standard_Integer IntegerFirst ()':
/usr/local/CAS5.2/inc/Standard_Integer.hxx:129: `INT_MIN' undeclared (first use this function)
/usr/local/CAS5.2/inc/Standard_Integer.hxx: In function `Standard_Integer IntegerLast ()':
/usr/local/CAS5.2/inc/Standard_Integer.hxx:135: `INT_MAX' undeclared (first use this function)
In file included from /usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:33,
from /usr/local/CAS5.2/inc/TCollection_Array1.lxx:1,
from /usr/local/CAS5.2/inc/TColgp_Array1OfPnt.hxx:135,
from incad/algos/convert/CasConvert.cpp:31:
/usr/local/CAS5.2/inc/Standard_SStream.hxx: At top level:
/usr/local/CAS5.2/inc/Standard_SStream.hxx:36: parse error before `{'
/usr/local/CAS5.2/inc/Standard_SStream.hxx:40: parse error before `&'
/usr/local/CAS5.2/inc/Standard_SStream.hxx:41: destructors must be member functions
/usr/local/CAS5.2/inc/Standard_SStream.hxx:42: parse error before `}'
In file included from /usr/local/CAS5.2/inc/Standard_DomainError.hxx:38,
from /usr/local/CAS5.2/inc/Standard_RangeError.hxx:38,
from /usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:38,
from /usr/local/CAS5.2/inc/TCollection_Array1.lxx:1,
from /usr/local/CAS5.2/inc/TColgp_Array1OfPnt.hxx:135,
from incad/algos/convert/CasConvert.cpp:31:
/usr/local/CAS5.2/inc/Standard_Failure.hxx:78: `aReason' was not declared in this scope
/usr/local/CAS5.2/inc/Standard_Failure.hxx:78: invalid data member initiailization
Mon, 08/30/2004 - 16:45
You are compiling your program not using all of the same pre-processor macro definitions that were used in building OCC itself.
For example, the CHAR_BIT error is because niether of the pre-processor macro definitions expected my Standard.hxx , HAVE_LIMITS or HAVE_LIMITS_H are definied for your compiliation.
One of these macros was defined for compiling OCC but neither are defined for your program.
Probably for a modern Linux distribution, -DHAVE_LIMITS could be added to your compile line, and will probably get past that particular error.
The best solution for this is to use GNU autoconf/automake/configure to build your own program. If you do this you can just add this stuff from the OCC configure.in to your program's configure.in file:
dnl Checks for header files.
Then you will have all the macros OCC is expecting defined for your project too.
Tue, 08/31/2004 - 14:18
Hi,
I still have problem.
I am using following flags:
CXX Flags :
-D_REENTRANT -D_GNU_SOURCE
CAS Flags :
-DLIN -DLININTEL -DNO_CXX_EXCEPTION -funsigned-char -O3 -DNo_Exception -Wall -x c++ -DCAS5 -Wno-deprecated
INCLUDES Flags :
-I/usr/local/jdk1.4/include -I/usr/local/jdk1.4/include/linux -I/usr/local/CAS5.2/inc
When I include -DHAVE_LIMITS first error goes and I get into following error:
In file included from /usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:33,
from /usr/local/CAS5.2/inc/TCollection_Array1.lxx:1,
from /usr/local/CAS5.2/inc/TColgp_Array1OfPnt.hxx:135,
from incad/algos/convert/CasConvert.cpp:31:
/usr/local/CAS5.2/inc/Standard_SStream.hxx:36: parse error before `{' token
/usr/local/CAS5.2/inc/Standard_SStream.hxx:40: parse error before `&' token
/usr/local/CAS5.2/inc/Standard_SStream.hxx:41: destructors must be member
functions
/usr/local/CAS5.2/inc/Standard_SStream.hxx:42: parse error before `}' token
In file included from /usr/local/CAS5.2/inc/Standard_DomainError.hxx:38,
from /usr/local/CAS5.2/inc/Standard_RangeError.hxx:38,
from /usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:38,
from /usr/local/CAS5.2/inc/TCollection_Array1.lxx:1,
from /usr/local/CAS5.2/inc/TColgp_Array1OfPnt.hxx:135,
from incad/algos/convert/CasConvert.cpp:31:
/usr/local/CAS5.2/inc/Standard_Failure.hxx:78: `aReason' was not declared in
this scope
/usr/local/CAS5.2/inc/Standard_Failure.hxx:78: invalid data member
initialization
/usr/local/CAS5.2/inc/Standard_Failure.hxx:78: (use `=' to initialize static
data members)
/usr/local/CAS5.2/inc/Standard_Failure.hxx:78: variable or field `Raise'
declared void
/usr/local/CAS5.2/inc/Standard_Failure.hxx:78: declaration of `int
Standard_Failure::Raise'
/usr/local/CAS5.2/inc/Standard_Failure.hxx:77: conflicts with previous
declaration `static void Standard_Failure::Raise(char* = )'
In file included from /usr/local/CAS5.2/inc/Standard_RangeError.hxx:38,
from /usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:38,
from /usr/local/CAS5.2/inc/TCollection_Array1.lxx:1,
from /usr/local/CAS5.2/inc/TColgp_Array1OfPnt.hxx:135,
from incad/algos/convert/CasConvert.cpp:31:
/usr/local/CAS5.2/inc/Standard_DomainError.hxx:65: `aReason' was not declared
in this scope
/usr/local/CAS5.2/inc/Standard_DomainError.hxx:65: invalid data member
initialization
/usr/local/CAS5.2/inc/Standard_DomainError.hxx:65: variable or field `Raise'
declared void
/usr/local/CAS5.2/inc/Standard_DomainError.hxx:65: declaration of `int
Standard_DomainError::Raise'
/usr/local/CAS5.2/inc/Standard_DomainError.hxx:64: conflicts with previous
declaration `static void Standard_DomainError::Raise(char* = )'
In file included from /usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:38,
from /usr/local/CAS5.2/inc/TCollection_Array1.lxx:1,
from /usr/local/CAS5.2/inc/TColgp_Array1OfPnt.hxx:135,
from incad/algos/convert/CasConvert.cpp:31:
/usr/local/CAS5.2/inc/Standard_RangeError.hxx:65: `aReason' was not declared in
this scope
/usr/local/CAS5.2/inc/Standard_RangeError.hxx:65: invalid data member
initialization
/usr/local/CAS5.2/inc/Standard_RangeError.hxx:65: variable or field `Raise'
declared void
/usr/local/CAS5.2/inc/Standard_RangeError.hxx:65: declaration of `int
Standard_RangeError::Raise'
/usr/local/CAS5.2/inc/Standard_RangeError.hxx:64: conflicts with previous
declaration `static void Standard_RangeError::Raise(char* = )'
In file included from /usr/local/CAS5.2/inc/TCollection_Array1.lxx:1,
from /usr/local/CAS5.2/inc/TColgp_Array1OfPnt.hxx:135,
from incad/algos/convert/CasConvert.cpp:31:
/usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:65: `aReason' was not declared in
this scope
/usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:65: invalid data member
initialization
/usr/local/CAS5.2/inc/Standard_OutOfRange.hxx:65: variable or field `Raise'
Regards
Senthil Kumar
Tue, 10/05/2004 - 13:12
hi,
i have the very same problem,
did u solve it? How?
Thx! the G.
Sat, 01/22/2005 - 21:29
Two ways, not sure which is the right one (depends on OCC compilation settings?). 1. #define USE_STL_STREAM, #include or 2. #include [deprecated]
Afterwards, DO NOT FORGET "using namespace std;" (OCC does not care about std); finally, you can #include
#include