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

我与影子孤独终老i 提交于 2019-12-19 11:36:05

问题


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!


回答1:


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...



来源:https://stackoverflow.com/questions/12487487/xcode-4-and-allegro-5-1-linker-cant-find-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!