Re: How to get details of link errors with Xcode?
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