On Aug 12, 2012, at 13:41 , Stephen Kay < email@hidden> wrote: After importing into Xcode, the Projects Inspector > Build > Mach O Type is set to "Static Library". Is this correct? (Seems wrong...because...)
According to what I've read, if it is a static library, it should have the suffix ".a". So I set it to that, and it successfully creates libMyLibrary.a (example).
In the parent project, I've included libMyLibrary.a, and in the inspector for the library, set the File Type to "archive".
But in the Target's Build Phase "Link Binary With Libraries", when you try to build this, it gives the error:
warning: skipping file 'foofoo/libMyLibrary.a' (unexpected file type 'archive' in Frameworks & Libraries build phase)
It seems to me you're doing something unnecessary/unwanted by changing the File Type manually. In general, you would only want to change it yourself if your file had the "wrong" extension. In this case, your library has the correct ".a" extension, so you should be able to let the File Type get set automatically.
I'd suggest you simply remove the library from the project's Groups & Files list, then add it back again and give it the correct target membership. If you want to use it as an ordinary library, that should be sufficient.
FWIW, though I don't have an Xcode 2.x project handy to look at, in Xcode 3.x the automatically-detected File Type shows as " archive.ar" for a simple libXXX.a library added to the project. The manual choice of "archive" may have been the only thing that was wrong.
|