• 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: Linking DefaultRuneLocale?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking DefaultRuneLocale?


  • Subject: Re: Linking DefaultRuneLocale?
  • From: Ian Joyner <email@hidden>
  • Date: Sun, 29 Apr 2007 22:04:43 +1000

On 29/04/2007, at 1:26 PM, Peter O'Gorman wrote:

On Apr 27, 2007, at 10:28 PM, Ian Joyner wrote:

I believe that DefaultRuneLocale might be in libSystem.dylib in the OS 10.4 sdk, but how do I get gcc to link to it (without Xcode)? My link command looks like:


gcc -o sample -O0 -pipe -no-cpp-precomp -fno-common -fPIC -I. - I../../../.. C1/Cobj1.o E1/eoption.o ../../../build/ Debug/Obj-C.o -framework AppKit -framework Foundation -framework CoreData /Developer/SDKs/MacOSX10.4.0.sdk/usr/lib/libSystem.dylib -lm


use -isysroot
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o sample -O0 -pipe - no-cpp-precomp -fno-common -fPIC -I. -I../../../.. C1/Cobj1.o E1/eoption.o ../../../build/Debug/Obj-C.o -framework AppKit -framework Foundation -framework CoreData

Thanks Peter for the above tip and Greg for detailed analysis below, I'll try following both these paths.


On 29/04/2007, at 3:49 AM, Greg Guerin wrote:

Ian Joyner wrote:

I believe that DefaultRuneLocale might be in libSystem.dylib in the OS
10.4 sdk, but how do I get gcc to link to it (without Xcode)?

"Believe" and "might" should be confirmed or refuted before proceeding:
nm /usr/lib/libSystem.dylib | grep RuneLocale


This shows a 'd' reference, which is a local (non-external) data symbol
definition.


The C symbol you want is actually _DefaultRuneLocale. The linker symbol
has 2 underbars, one of which the C compiler puts there, the other of which
is in the C source.

Right, I just took the underscore off in my post, but I had not noticed the second one.

This command: apropos RuneLocale

indicates some deprecated functions, and the man page says they're in libc.
Applying 'ls -l' to /usr/libc* shows that libc is a symlink to libSystem,
so linking against libc or libSystem should resolve the symbol.



To figure out how to link against an SDK version of a library, look at
Xcode's detailed build transcript when you compile a universal binary with
an SDK base.


Since you didn't describe your Xcode experience level, if "Xcode build
transcript" means nothing to you, search for "build transcript" in this
list's archives. It comes up regularly.

Well, I've been a pretty regular user since ProjectBuilder DP 3 in about 2000. My little project is getting another development environment, a little like Eclipse, but not Java, interfacing to Cocoa, so I'm actually getting this environment to generate and compile the gcc and then trying to get Xcode to do the Cocoa specific builds, eventually with the aim of being able to do this either in the other environment or in Xcode, but not having to do both, so that like Eclipse with Java, programmers can choose whichever environment they find best. Mac programmers will probably stick with Xcode, whereas programmers porting from other machines may not want to get into Xcode. So I'm sort of poking around with the internals of the build systems of both environments, and certainly picking the build transcripts to bits!

The evidence suggests that adding the System framework to your Xcode
project will lead libSystem.dylib to be linked against. You should then be
able to see the desired option in the build transcript and replicate it
outside of Xcode.


-- GG

Thanks to both of you again, at least I have some better direction to go in now.


Ian
_______________________________________________
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: Linking DefaultRuneLocale? (From: Greg Guerin <email@hidden>)

  • Prev by Date: -m64 on Intel works with gcc but not Xcode
  • Next by Date: Re: -m64 on Intel works with gcc but not Xcode
  • Previous by thread: Re: Linking DefaultRuneLocale?
  • Next by thread: XCode and dot in the binary name
  • Index(es):
    • Date
    • Thread