help!!! compile warning and can not run

when compile and build my program that use opencascade libs, I got the followings:

[wangle@r050238 test_opencasade]$ make
g++ -I/home/wangle/OpenCASCADE6.1.0/ros/inc/ -o pegsi /home/wangle/OpenCASCADE6.1.0/ros/lin/lib/*.so /home/wangle/OpenCASCADE6.1.0/3rdparty/Linux/tcltk/lib/*.so LoadStep.cpp
/usr/bin/ld: warning: libstdc++.so.5, needed by /home/wangle/OpenCASCADE6.1.0/ros/lin/lib/libBinLPlugin.so, may conflict with libstdc++.so.6
/usr/bin/ld: warning: libtcl.so.0, needed by /home/wangle/OpenCASCADE6.1.0/ros/lin/lib/libTKWOK.so, not found (try using -rpath or -rpath-link)

And , when I run it:

[wangle@r050238 test_opencasade]$ ./pegsi
./pegsi: error while loading shared libraries: libtcl.so.0: cannot open shared object file: No such file or directory

the following is my .cpp file:

#include
#include "STEPControl_Reader.hxx"
#include "TopoDS_Shape.hxx"
#include "BRepTools.hxx"
int main () {
STEPControl_Reader::STEPControl_Reader reader;
reader.ReadFile("screw.step");
return 0;
}

Thanks!

Lejing

Rob Bachrach's picture

I think you are really causing a lot of unnecessary problems by including all the OCC libraries in your makefile. Right now, you are including libraries for the test harnesses and WOK development environment, in addition to the actual API libraries. I think you will find that these problems go away by including only those OCC libraries needed by your app.

Unfortunately, finding out what is needed by your app can be the hard part, but just requires a small amount of iteration. If you look in the reference documentation, each "Toolkit" is the name of a library (e.g., TKernel, TKMath, TKAdvTools, etc.). Just off the top of my head, for your application, I would probably start with:
- all the FoundationClasses toolkits
- all the ModelingData toolkits
- TKGeomAlgo, TKTopAlgo, TKPrim, TKShHealing from ModelingAlgorithms
- TKXSBase, TKSTEPBase, TKSTEPAttr, TKSTEP209, TKSTEP from DataExchange

Then, if you get undefined symbols, you can add libraries as necessary.

Good luck,
Rob