Search code examples
xcodexcode4linkerallegroallegro5

Xcode 4 and Allegro 5.1 - Linker can't find Framework


I know there are several other questions here regarding the Linker and Xcode 4, but they don't really relate to my problem.

I've built Allegro 5.1 and it took me a while because of FreeType, but eventually it worked. Now I've written a little Space Invader game using Allegro. But somehow the linker can't find the framework.

What I've done so far:

  • The Frameworks are located at /Library/Frameworks/ and they have the same structure like all the other frameworks in that place
  • I've added the frameworks to the "Link Binary With Libraries" tab of my target
  • I've added them in a "Copy Files" tab on my target with Destination "Frameworks"
  • I've added the correct path settings in the Build Settings, so the header files can be found

I've done all the right steps, but still I get:

ld: framework not found Allegro-5.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I already had a working framework, but it was installed as shared libs and not in "framwork mode". But adding the framework components to the project was kinda hard because they were stored in /usr/local/lib, which can't be selected with the file dialog...

So... I have no idea what else there should be to do. When I had the shared libs it worked, but now with the same setting but different location it doesn't anymore. Tell me if you need more information, I'll provide it!


Solution

  • So, in case someone lands here, with the help of elias in the Allegro IRC I've found the "error":

    In my targets Build Settings I had to specify the Framework Search Paths as /Library/Frameworks.

    This doesn't really make sense to me, since this is the default directory for the Frameworks on Mac OS X, but whatever...