Re: strange link error: ld: Undefined symbols: _sprintf$LDBLStub
Re: strange link error: ld: Undefined symbols: _sprintf$LDBLStub
- Subject: Re: strange link error: ld: Undefined symbols: _sprintf$LDBLStub
- From: Bill Northcott <email@hidden>
- Date: Thu, 18 Aug 2005 11:03:06 +1000
On 18/08/2005, at 5:14 AM, Sean McBride wrote:
- I have 2 static libs (C not C++!), libminc.a and libvolume_io.a,
they
are built with gcc 4 (build 5026)
- I have an Xcode 2.2 project that uses these 2 libraries
- if I use gcc 3.3 I get link errors: _sprintf$LDBLStub etc.
- if I use gcc 4.0 I don't have those link errors
- I have a CodeWarrior 9.5 project that uses these 2 libraries, it
also
won't link, also complaining about _sprintf$LDBLStub and _fprintf
$LDBLStub. The CW project did link when the libraries were built with
gcc 3.3.
So something changed with gcc 4, but what? What is this SystemStubs
thing? Why might I need it?
Why can't a C lib built with one one compiler be used by another? I
don't remember having these problems with CFM!
The runtime library system changed between gcc-2.x and gcc-3.x and
again between gcc-3.x and gcc-4.x. that is why the major version
number changes. You get the errors because there is a new library
you are not linking. The same happens frequently with Fortran when
people try to use g77 with gcc-4 or gfortran with gcc-3. Same problem.
Basically you cannot link objects produced by gcc compilers with
different major versions. This is one reason why static libraries
are deprecated on MacOS X. The only one distributed by Apple are
safely buried in the versioned areas of the gcc library tree. If you
use dynamic libraries, it makes no difference what compiler they were
built with. Static libraries should only be used as intermediate
convenience libraries included in a larger build process using one
compiler throughout.
Bill Northcott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden