Re: Unable to directly link against dynamic library libicucore
Re: Unable to directly link against dynamic library libicucore
- Subject: Re: Unable to directly link against dynamic library libicucore
- From: John Engelhart <email@hidden>
- Date: Thu, 3 Apr 2008 18:54:08 -0400
On Mar 30, 2008, at 4:49 PM, Sam Krishna wrote:
(Running XCode 3.0 + Leopard 10.5.2 on intel)
I'm trying to use RegexKitLite to add some simple regex support for
a Foundation tool. I've followed the instructions listed here to add
the libicucore dynamic library to the 'External Frameworks and
Libraries' folder (located at /Developer/SDKs/MacOSX10.5.sdk/usr/lib/
libicucore.dylib).
Hi Sam. I'm the author of RegexKitLite. Sorry about the problems
you're having. I just recently did an update to the documentation to
address this very point. Having read your message I thought I would
go through and double check to make sure that the updated
documentation worked. And of course, it doesn't. Seems to be a
cursed topic. I had a feeling when I was putting everything together
that "linking to the icucore library is going to be the hardest part."
After adding it, I've tried to build the tool, and I keep getting
this warning:
warning: skipping file '/Developer/SDKs/MacOSX10.5.sdk/usr/lib/
libicucore.dylib' (unexpected file type 'compiled.mach-o' in
Frameworks & Libraries build phase)
I got this too, though I could have sworn that this didn't happen when
I was writing up the documentation. I don't know why it's such a
difficult and involved process to add a new library or framework to
your project in Xcode, but it's a real PITA, at least if you want to
do it 'properly'.
I did find the reason for the warning message, though. It seems that,
for whatever reason, when you select the icucore library via /
Developer/SDKs/..., xcode considers it a (surprise) 'compiled.mach-o'
file. If you select the libicucore.dylib file on the left hand side
pane and "Get Info", the General tab will have the file type.
Selecting 'compiled.mach-o.dylib' fixes the problem, no more warning
and it properly links to the library.
Now, I can workaround this by putting in the '-licucore' flag in the
"Other Linker Flags" in the Build Inspector, but it seems kinda bogus.
The funny thing is, you can do a lot of extra work so that Xcode can
put '-licucore' in to its internal equivalent of 'Other Linker Flags'.
Two Qs:
(1) Why would I get the above warning, given that 'compiled.mach-o'
is the native binary format on X?
(somewhat redundant answers..)
See above, Xcode does not seem to give it the correct file type. You
have to manually switch the files type to compiled.mach-o.dylib for
some reason.
(2) How do I directly link against said library w/o modifying the
"Other Linker Flags"?
Again, the above modification will fix the 'problem'.
Thanks!
To the list at large,
Does anyone have a best-practices way of adding libraries like icucore
to an Xcode project? This seems kind of ridicules, there must be ten
to fifteen steps to add a single library. Not to mention the hoops
you have to jump through if you want to add a library that doesn't
show up in the file chooser (i.e., /usr/local/lib).
Does everyone just punt and stick a "-licucore" in to "Other Linker
Flags"? The Xcode users guide is essentially silent on the issue (http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_08_bs_linking/chapter_36_section_1.html
). I'm sort of torn between trying to write up documentation for
doing it "properly" or just going with the "Other Linker Flags" route,
which is much simpler and easier. Thoughts?
_______________________________________________
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