For Programmers: Free Programming Magazines  


Home > Archive > Compilers > August 2004 > Linking with different compilers









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Linking with different compilers
Bill

2004-08-23, 4:02 pm

I have some libraries from one vendor that was built with gcc 3.0.2. I
have another set of libraries from another vendor that was built with
gcc 3.3.

I need to link a program that uses both libraries. I can get the two
vendors stuff to link finally, but I'm having trouble with libstdc++
and libgcc_s. The first vendor supplied a version of these in his junk
and I have another version for gcc 3.3. I get incompatibulities
between libstdc++.so.3 in 3.0.2 and libstdc++.so.5 in gcc 3.3. Both
have a libgcc_s.so.1.

When I run the program, I get something to the effect:

exe : library : version GCC_3.3 not found (requied by
..../libstdc++.so.5

I running into problems when I run, in that it can't find versions.

Am I screwed? Or is there someway out of this? Neither vendor is
willing to redo their libraries.

Can I relink the 3.3 shared libries to make them static? I've also
tried to statically link in the 3.3 libstdc++.a library to no avail.

Help is appreciated in advance.

BTW, this is Linux 7.3 on Intel.

Thanks,
Paul Pluzhnikov

2004-08-25, 3:59 pm

bill.volz@chevrontexaco.com (Bill) writes:

> I have some libraries from one vendor that was built with gcc
> 3.0.2. I have another set of libraries from another vendor that was
> built with gcc 3.3.


This would not be a problem for C, but for C++ you might as well
consider this code to be compiled by different compilers.

The class layout has changed between these versions, and so did
name mangling. The objects are not link-compatible.

> I need to link a program that uses both libraries.


You can't.

> Am I screwed?


Yes.

> Can I relink the 3.3 shared libries to make them static?


No: shared libraries on most UNIX systems are considered a "final"
product, and can't be re-linked any more than you can re-link an
existing executable.

> BTW, this is Linux 7.3 on Intel.


You'll probably get answers faster in comp.os.linux.development.{apps,system}.

Cheers,
--
In order to understand recursion you must first understand recursion.

Unknown

2004-08-25, 3:59 pm

I had a similar problem at work not long ago. We ended up convincing
the vendor to recompile with gcc 3.3 after trying fake the
libstdc++.so.3 by symlinking it from libstdc++.so.5. Unfortunately
encountered symbol changes from libstdc++.so.3 to libstdc++.so.5.

I am not sure if you can statically link in the code.

One possible way out of this conundrum is to wrap each library as a
RPC/CORBA server and make method calls between them as needed. I must
admit it is not the nicest of solutions.

Best of luck

tee

On Mon, 23 Aug 2004 12:11:26 -0400, Bill wrote:

> I have some libraries from one vendor that was built with gcc 3.0.2. I
> have another set of libraries from another vendor that was built with
> gcc 3.3.
>
> I need to link a program that uses both libraries. I can get the two
> vendors stuff to link finally, but I'm having trouble with libstdc++
> and libgcc_s. ...

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com