XCode does not find libraries in an umbrealla framework
XCode does not find libraries in an umbrealla framework
- Subject: XCode does not find libraries in an umbrealla framework
- From: Andreas Grosam <email@hidden>
- Date: Tue, 22 Mar 2005 15:13:59 +0100
I have a project linking against several other third party frameworks.
They are located in a non-standard location, means not in /Library/Frameworks.
It turned out, that i have to specify the framework path explicitly in the build settings - regardless whether XCode should know them because they are propperly inserted and referenced in the project. In brief, XCode does not automatically generate a -F<framework> option for the frameworks you placed into the project.
Thus, I specified the frameworks search paths explicitly to point to my "local third party" frameworks folder.
When compiling the headers and libraries in normal frameworks will be found.
However when linking, the libraries in an *umbrella* framework will not be found. The linker ld falls back to search in the standard location /Library/Frameworks and issues a warning/error that the lib can't be located there (of course). (see below)
IMO, the options for linking are correct:
the framework paths are correctly specified (
<x-tad-smaller>-F/Users/agrosam/Develop/OGRE/Frameworks</x-tad-smaller>), and the linker option -framework myFramework correctly specifies to link against this third party framework:
<x-tad-smaller>Ld /Users/agrosam/Develop/OGRE/ogrenew/Mac/XCode/Ogre/build/Ogre.framework/Versions/A/Ogre
cd /Users/agrosam/Develop/OGRE/ogrenew/Mac/XCode/Ogre
/usr/bin/g++-3.3 -o /Users/agrosam/Develop/OGRE/ogrenew/Mac/XCode/Ogre/build/Ogre.framework/Versions/A/Ogre -L/Users/agrosam/Develop/OGRE/ogrenew/Mac/XCode/Ogre/build -L/usr/X11R6/lib -F/Users/agrosam/Develop/OGRE/ogrenew/Mac/XCode/Ogre/build </x-tad-smaller><x-tad-smaller>-F/Users/agrosam/Develop/OGRE/Frameworks</x-tad-smaller><x-tad-smaller> -filelist /Users/agrosam/Develop/OGRE/ogrenew/Mac/XCode/Ogre/build/Ogre.build/Ogre.build/Objects-normal/Ogre.LinkFileList -framework Cocoa -lz -lfreetype </x-tad-smaller><x-tad-smaller>-framework IL</x-tad-smaller><x-tad-smaller> -framework zzip -arch ppc -prebind -Wl,-single_module -dynamiclib -compatibility_version 1 -current_version 1 -install_name "@executable_path/../Frameworks/Ogre.framework/Versions/A/Ogre"
</x-tad-smaller>
The issued error message indicates that ld would search the library in the correct paths, but just fails to locate the correct root folder:
<x-tad-smaller>ld: warning can't open dynamic library: </x-tad-smaller><x-tad-smaller>/Library/Frameworks</x-tad-smaller><x-tad-smaller>/IL.framework/Frameworks/lcms.framework/Versions/A/lcms (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
ld: Undefined symbols:
_TIFFClientOpen referenced from IL expected to be defined in </x-tad-smaller><x-tad-smaller>/Library/Frameworks</x-tad-smaller><x-tad-smaller>/IL.framework/Frameworks/libtiff.framework/Versions/A/libtiff
</x-tad-smaller>It looks like that this problem only occurs when searching libs in umbrella frameworks. When the library is in a normal framework it will be found. For instance, ld successfully references the symbols in framework zzip. (I changed the order for linking against zzip and IL to check this).
Well, in brief, there are these problems:
1) XCode does not generate the corresponding -F<framework> option automatically from the project settings in order to specify the framework paths for the compiler/linker.
2) The linker ld does not find libraries in umbrella framworks if they are located in non-standard locations.
(although not checked, i suppose ld will find them when they are located in standard locations :-) )
I would like to know, if anybody else encountered this issue already.
If this is Xcode and not me, the workaround is simple: place all frameworks into standard locations.
If it is my fault, i would like to know what i can do.
thanks
Regards
Andreas Grosam
_______________________________________________
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