For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

problem with my app going from 3.0 to 4.0

Anonymous's picture
Forums: 

Hi all:

I was using 3.0 before and all I had to do to link my app was to link with:
TKV2d TKV3d TKG2d TKG3d. Worked great.

Now, with 4.0, when I link, I get undefined references for stuff that's in TKBRep
so I add the lib to my linker but it seems it does not make any difference.
It looks like the linker does not get the symbols from the shared libs even though all the shared libs are there in CASROOT/Linux/lib. Weird.

anybody can help me ?

thanks,
hugues -

Gilles J. Seguin's picture

for linux system, you have to show that your assumption are corrects.

You have probably done something like
$ make 2>&1 | tee make-apr06.log

From the log file, that is make-apr06.log you can paste the output/result of the libtool command. That is the command line beginning with g++.

To support your claim about the library that are included, you will add another options flag, here -V.
This will have for effect for gcc to display the line that is process by the linker, where all the libraries will show up. If all your assumptions are OK, we go more deeper.

You do this using binutil utilities. For example,
I beleive that BRep_TEdge is in the TKBRep library
$ cd src/TKBRep/.libs
$ nm -CD libTKBRep.so.0.0.0 | grep BRep_TEdge
will tell you about it
000745a4 T BRep_TEdge_Type_()
[...]
It does have infornations that resolve external reference for it.
000745a4 U BRep_TEdge_Type_()
will ask for another library to resolve the unknow address reference.

If you have a mangle name, you do
$ c++filt _ZN10BRep_TEdgeC1Ev

Show the pertinent informations that make you beleive the build is broken.

hugues's picture

thanks Gilles for your answer.

I am not sure I understand what you are presenting. I am far from being expert in unix.

If I do a 'nm' on the libs, it looks normal. If I do

nm -CD libTKBRep.so.0.0.0 | grep BRep_TEdge

I get what you are saying.

It looks like the libs are not corrupt as fas as I can tell:

If I do a 'ls -all' on libTKBRep.so, I get:
-rwxr-xr-x 1 318 450 1299251 Sep 5 2001

hugues -

hugues's picture

I forgot to mention that I was using opencascade 3.0 with redhat 7.2 (with no problems, everything great)
then I switched to opencascade 4.0 with suse 8.1 and that's when I started having problems (cannot link my apps)

thanks,
hugues -

Gilles J. Seguin's picture

You must must insure that your object file are compatible.

Everything compile with g++ 2.95 will have to be recompile and relink for g++ 3.[012].*
because they are binary incompatible.

You can check with
$ objdump -s -j .comment libTKBRep.so.0.0.0
You can also verify requiered library with
$ readelf -d libTKBRep.so.0.0.0
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libTKGeomBase.so.0]
0x00000001 (NEEDED) Shared library: [libTKG3d.so.0]
0x00000001 (NEEDED) Shared library: [libTKG2d.so.0]
0x00000001 (NEEDED) Shared library: [libTKMath.so.0]
0x00000001 (NEEDED) Shared library: [libTKernel.so.0]
0x00000001 (NEEDED) Shared library: [libdl.so.2]
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000e (SONAME) Library soname: [libTKBRep.so.0]
0x0000000f (RPATH) Library rpath: [/usr/cas/OCC/OCC/src/TKGeomBase/.libs:/usr/cas/OCC/OCC/src/TKG3d/.libs:/usr/cas/OCC/OCC/src/TKG2d/.libs:/usr/cas/OCC/OCC/src/TKMath/.libs:/usr/cas/OCC/OCC/src/TKernel/.libs]

hugues's picture

my gcc-c++ is 3.2-36, so that must be my problem.

I guess I was on the right track recompiling all the libs myself. I gave up though since I had problem with libTKernel, but I'll give it another shot.

thanks, Gilles, for your help.

hugues -

hugues's picture

I also forgot to mention the following:

I tried to build the libs myself (TKV2d TKV3d TKG2d TKG3d TKBRep) using 'csh -f TKV2d.comp', etc in CASROOT/adm/Linux

Doing that it seems the linker sees the symbols but I end up with an undefined reference to Standard::MAllocate and others, so then I have tried to build TKernel, but I can't since it does not compile all the objects. So I am stuck. I don't think I should need to build all the libs myself so I don't really want to go into the details of why I could not compile.

hugues -

Gilles J. Seguin's picture

You have to show that the link command line look for libTKernel,
add -V to the command line.

You have to show that you do not have Standard::MAllocate.

$ nm -DC libTKernel.so.0.0.0 | grep Standard::MAllocate
001505a4 T Standard::MAllocate(int)

The "T" tag says that the library is providing symbo reference resolution

$ objdump -C -t Standard.o | grep Standard::MAllocate
00000df0 g F .text 00000306 Standard::MAllocate(int)

hugues's picture

ok, Gilles, I see what you mean.

I've got to recompile all the libs I need. If I have further problems, I'll start another thread with a more specific problem.

thanks for your help.

BTW, is there a place where I can get Linux libs that are compatible with gcc-c++ version 3.2-36. that would save me some time.

thanks,
hugues -

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.