Help with OpenCascade 6.2 on ubuntu hardy - beginner


I managed to install open cascade 6.2 on my unbuntu with the seetup.jar installer. Also I was able to run the configure and succesfull make the library (after adding the -ffriend-injection and -fpermissive options to CXX flags)

But now that I have done all this, I want to use this library to write a simple program (just for starters.)


int main () {

STEPControl_Reader reader;

IFSelect_ReturnStatus stat = reader.ReadFile("screw.stp");

return 0;

to just to check the functionality !!

I am not able to to compile this code !!!

can anyone please tell me the how my makefile should look for this ??
what all should use as the include directories, which libraries I should be linking....??

can anyone please help me out with this...thanks a lot !!

Dirk B's picture

Here's a basic Makefile. I compiled your main with it on my Suse box, there are way too many libraries in there, just try to remove the ones you don't need.



CXX= g++ -g

OCC_LIBS=-L/opt/OpenCASCADE6.2.0/ros/Linux/lib/ \
-L/opt/OpenCASCADE6.1.0/ros/../3rdparty/Linux/tcltk/lib/ \
-lTKXSBase -lTKXSDRAW -lXCAFPlugin -ltk -L/usr/lib -L/opt/gnome/lib \
-lBinLPlugin -lBinPlugin -lBinXCAFPlugin -lFWOSPlugin -lmscmd -lPTKernel -lStdLPlugin -lStdPlugin \
-lTKAdvTools -lTKBin -lTKBinL -lTKBinXCAF -lTKBO -lTKBool -lTKBRep -lTKCAF -lTKCDF -lTKCDLFront \
-lTKCPPClient -lTKCPPExt -lTKCPPIntExt -lTKCPPJini -lTKCSFDBSchema -lTKDCAF -lTKDraw -lTKernel \
-lTKFeat -lTKFillet -lTKG2d -lTKG3d -lTKGeomAlgo -lTKGeomBase -lTKHLR -lTKIDLFront -lTKIGES -lTKLCAF \
-lTKMath -lTKMesh -lTKMeshVS -lTKOffset -lTKOpenGl -lTKPCAF -lTKPLCAF -lTKPrim -lTKPShape \
-lTKService -lTKShapeSchema -lTKShHealing -lTKStdLSchema -lTKStdSchema -lTKSTEP -lTKSTEP209 \
-lTKSTEPAttr -lTKSTEPBase -lTKSTL -lTKTCPPExt -lTKTopAlgo -lTKTopTest -lTKV2d -lTKV3d -lTKViewerTest \
-lTKXSBase -lTKXSDRAW -lXCAFPlugin -lXmlLPlugin -lXmlPlugin -lXmlXCAFPlugin -ltk -lXmu -L/usr/lib \
-L/usr/X11R6/lib -L/opt/gnome/lib -pthread -lpng -lSM -lICE \
-lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 \
-lz -lm -lgthread-2.0 -lglib-2.0 -ldl -lGLU -lGL -lpthread

LIBS=-L/opt/OpenCASCADE6.2.0/ros/../3rdparty/Linux/tcltk/lib/ \
-ltk -L/usr/lib -L/opt/gnome/lib

all: occ_cmd

.SUFFIXES: .o .c .cpp .cc .cxx .C

$(CXX) $(DEFINES) -c $(CXXFLAGS) $(OCC_INC) -o "$@" "$<"

$(CXX) $(DEFINES) $(OCC_INC) $(OCC_LIBS) main.cpp -o $@ $(LIBS)

fulcrum_xyz's picture

Hi dirk

Thanks a lot for the makefile, I will check it out..hopefully with this I should be able to make this work :)