Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
SOLVED? -> Re: Fwd: Error linking in Xcode 2.1 (undefined symbols in libSystem)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED? -> Re: Fwd: Error linking in Xcode 2.1 (undefined symbols in libSystem)



Hi all,

After more searching I found that some people have worked around this problem by including libSystemStubs.a. I tried it and it did resolve the link problems. And initial testing of the resulting applications look good.

Unfortunately in our case we want to provide gcc 4.0 static libraries to customers who might want to build against gcc 3.3. So I guess we'll have to teach them to include libSystemStubs.a when building under gcc 3.3.

But honestly I don't know what libSystemStubs.a is for or whether including it in a gcc 3.3 build is in fact the right work around. Frankly it would be nice to have a better understanding of the interrelationships between gcc 3.3 and 4.0 static libraries. Maybe someone from Apple would care to comment?

If this has been covered before or is documented elsewhere and I missed it, then I apologize.

Best,
--
Allen Cronce

Allen Cronce wrote:
Hi Milke,

I'm seeing a very similar set of errors. Did you resolve this problem?

What's happening in my case is I've built some static libraries using gcc 4.0. When I try to link against these libraries from a project built with gcc 3.3, I get this link error:

ld: Undefined symbols:
_sprintf$LDBLStub
_printf$LDBLStub
_sscanf$LDBLStub
_fprintf$LDBLStub

We need to provide these static libraries to our customers. Does the above error mean that we have to build and provide both gcc 3.3 and 4.0 generated libraries? Or is there some other work around that will allow us to build static libraries under gcc 4.0 that will link with gcc 3.3?

Best regards,
--
Allen Cronce

Dragan Milić wrote:
Begin forwarded message:

From: Dragan Milić
Date: sreda, 06.07.2005. 12:53:02 CET
To: Xcode-users Mailing List <email@hidden>
Subject: Error linking in Xcode 2.1 (undefined symbols in libSystem)


Hi everyone,

I have a couple of small projects, compiled and linked under Mac OS X 10.3.9 and Xcode 1.5. Recently I've switched to Tiger and Xcode 2.1. I succeded to rebuild all my projects, except one. Compiling goes fine, but when linking I get these errors:

/usr/bin/ld: Undefined symbols:
_snprintf$LDBLStub
_sscanf$LDBLStub
_printf$LDBLStub
_strtod_l referenced from AppKit expected to be defined in libSystem
_snprintf_l referenced from AppKit expected to be defined in libSystem
_sprintf_l referenced from AppKit expected to be defined in libSystem
_sscanf_l referenced from AppKit expected to be defined in libSystem
_OSSpinLockLock referenced from AppKit expected to be defined in libSystem
_OSSpinLockUnlock referenced from AppKit expected to be defined in libSystem

.........................................................................

_TXTRecordDeallocate referenced from CFNetwork expected to be defined in libSystem
_TXTRecordGetBytesPtr referenced from CFNetwork expected to be defined in libSystem
_TXTRecordGetCount referenced from CFNetwork expected to be defined in libSystem
_TXTRecordGetItemAtIndex referenced from CFNetwork expected to be defined in libSystem
_TXTRecordGetLength referenced from CFNetwork expected to be defined in libSystem
_TXTRecordSetValue referenced from CFNetwork expected to be defined in libSystem
collect2: ld returned 1 exit status


There are a lot of reports like these above, and they all refer to libSystem as being the source of the problem. I tried with many build options, but I couldn't get that particular project to link and build. Any help would be highly appreciated.

Milke.

Maybe I should add that I'm linking against "Current Mac OS" SDK (MacOSX10.4), I'm not using MacOSX10.4u, since I'm not building universal binary. Also, when building I've noticed reports of precompiling of 2 prefix headers, although the project contains only one prefix header file, created automatically during creation of the project, the one that imports <Cocoa/Cocoa.h> inside "#ifdef __OBJ_C__  ...  #endif" clause. Again, this happens only when linking one particular project, others work fine, which confuses me even more.

When building development build (with ZeroLink) everything goes without any problem.

Cheers
Milke





 _______________________________________________
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

References: 
 >Error linking in Xcode 2.1 (undefined symbols in libSystem) (From: Dragan Milić <email@hidden>)
 >Fwd: Error linking in Xcode 2.1 (undefined symbols in libSystem) (From: Dragan Milić <email@hidden>)
 >Re: Fwd: Error linking in Xcode 2.1 (undefined symbols in libSystem) (From: Allen Cronce <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.