Errors including headers

Hello,

I'm trying to compile a simple C++ file just to read an IGES file :

----------------------------------------------------------------
#include

using namespace std;

main()
{
IGESControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile("test-yves.igs");
exit(0);
}
---------------------------------------------------------------

using this script to compile :

----------------------------------------------------------------
#!/bin/bash
CC=cc
CXX=g++
MOC=/usr/lib/qt2//bin/moc
MSG2QM=/usr/lib/qt2//bin/msg2qm

X_INCLUDES=-I/usr/X11R6/include
GL_INCLUDES=-I/usr/include
QT_INCLUDES=-I/opt/OpenCASCADE5.2/3rdparty/Linux/Qt
OCC_INCLUDES=-I/opt/OpenCASCADE5.2/ros/inc

X_LDFLAGS=-L/usr/X11R6/lib
GL_LDFLAGS=-L/usr/lib
QT_LDFLAGS=-L/opt/OpenCASCADE5.2/3rdparty/Linux/Qt
OCC_LDFLAGS=-L/opt/OpenCASCADE5.2/ros/Linux/lib

LIB_X="-lX11 -lXext -lXmu"
LIB_GL="-lGL -lGLU"
LIB_QT="-lqt -lpthread"
LIB_OCC="-lTKernel -lTKMath -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lT
KFeat -lTKFillet -lTKOffset -lTKHLR -lTKService -lTKV2d -lTKV3d -lTKPCAF -lTKCDF -lTKCAF -lPTKernel -lTKIGES -lT
KSTEP -lTKSTL -lTKVRML -lTKShHealing -lTKXSBase -lTKPShape -lTKShapeSchema -lTKOpenGl -lTKBO -lTKBool -lTKTopAlg
o -lTKPrim -lTKOffset -lTKFillet -lTKBO"

CFLAGS="-DCSFDB -DNO_CXX_EXCEPTION -DNo_Exception -DLIN -DLININTEL"
CXXFLAGS="-DCSFDB -DNO_CXX_EXCEPTION -DNo_Exception -DLIN -DLININTEL"
LDFLAGS=-L/usr/X11R6/lib
LIBS="-lm -ldl -lc"

g++ $CXXLAGGS $X_INCLUDES $GL_INCLUDES $QT_INCLUDES $OCC_INCLUDES $LDFLAGS $X_LDFLAGS $QT_LDFLAGS $GL_DFLAGS $OC
C_LDFLAGS $LIBS $LIB_X $LIB_QT $LIB_OCC $LIB_GL -o $1 $1
-----------------------------------------------------------

I get multiple errors including . Here are the first error messages :

-----------------------------------------------------------
In file included from /opt/OpenCASCADE5.2/ros/inc/Standard_Address.hxx:20,
from /opt/OpenCASCADE5.2/ros/inc/Standard.hxx:28,
from /opt/OpenCASCADE5.2/ros/inc/Handle_XSControl_WorkSession.hxx:29,
from /opt/OpenCASCADE5.2/ros/inc/IGESControl_Reader.hxx:26,
from testiges.cpp:2:
/opt/OpenCASCADE5.2/ros/inc/Standard_Integer.hxx: In function `Standard_Integer
IntegerFirst()':
/opt/OpenCASCADE5.2/ros/inc/Standard_Integer.hxx:129: error: `INT_MIN'
undeclared (first use this function)
/opt/OpenCASCADE5.2/ros/inc/Standard_Integer.hxx:129: error: (Each undeclared
identifier is reported only once for each function it appears in.)
/opt/OpenCASCADE5.2/ros/inc/Standard_Integer.hxx: In function `Standard_Integer
IntegerLast()':
/opt/OpenCASCADE5.2/ros/inc/Standard_Integer.hxx:135: error: `INT_MAX'
undeclared (first use this function)
/opt/OpenCASCADE5.2/ros/inc/Standard_Integer.hxx: In function `Standard_Integer
IntegerSize()':
/opt/OpenCASCADE5.2/ros/inc/Standard_Integer.hxx:141: error: `CHAR_BIT'
undeclared (first use this function)
--------------------------------------------------------------

I have many other errors in other headers and i'm wondering how to solve it. I'm using Linux and gcc-3.3.4.

Any Ideas ?

Thanks in advance.

f-kosche's picture

Hi Etienne,

I have the same problem, did you find a fix or work
around?

Thanks Florian

Etienne LORRIAUX's picture

Hello Florian,

it's been a long time i've fix it and don't remember exactly how.

Try adding '-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DHAVE_LIMITS_H' in CXXFLAGS