• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get details of link errors with Xcode?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get details of link errors with Xcode?


  • Subject: Re: How to get details of link errors with Xcode?
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 18 Aug 2005 11:17:45 -0400
  • Organization: Rogue Research

On 2005-08-18 10:56, Mark Dalrymple said:

> > The correct way to link code is using the gcc compiler driver which
> > automatically includes the necessary system libraries and invokes
>libtool,
> > ld, and even lipo repeatedly if needed.
>
>Not necessarily.  For example, using the function asl_log in a
>program that is completely build by gcc will give you the blarg
>$LDBLStub errors:
>
>#include <asl.h>
>
>int main (void)
>{
>     asl_log (0, 0, 0, "test");
>
>     return (0);
>
>} // main
>
>% gcc -g -Wall -o asl_log asl_log.c
>/usr/bin/ld: Undefined symbols:
>_asl_log$LDBLStub
>collect2: ld returned 1 exit status
>
>
>Using any non-vararg function will link propery.  Any vararg function
>will get the $LDBLStub complaint.  All of the LDBLStub complaints
>I've seen from folks have been vararg functions.

Interesting!  And in my case it's sprintf, which is of course vararg...

>I presume that the
>long double support in gcc 4 (hence the LDBL part) is the root cause
>of the issue.

Ah, so that's what LDBL is, thanks!

>This little program compiles fine in Xcode

It doesn't for me.  I tried with both a "standard tool" and "cocoa
application".  Of course it links in Debug (due to ZeroLink no doubt),
but not in Release.

>and you can get it to
>compile ok from the command line by setting the
>MACOSX_DEPLOYMENT_TARGET env var before building with gcc.

In my 2 Xcode test projects, this is also the case if I set
MACOSX_DEPLOYMENT_TARGET to 10.4.  If I set it to 10.3, I still get the
link error. Then again, the asl_log man page says it was added in 10.4,
so that's not so surprising.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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: 
 >Re: How to get details of link errors with Xcode? (From: Bill Northcott <email@hidden>)
 >Re: How to get details of link errors with Xcode? (From: Mark Dalrymple <email@hidden>)

  • Prev by Date: Re: How to get details of link errors with Xcode?
  • Next by Date: Re: Can't tell build configurations to use different libraries
  • Previous by thread: Re: How to get details of link errors with Xcode?
  • Next by thread: Debug Problem with Simple Pgm
  • Index(es):
    • Date
    • Thread