在XCode中构建FreeType错误 [英] FreeType error when building in XCode

查看:446
本文介绍了在XCode中构建FreeType错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先回一些故事:

我不知道自己在做什么。

I dont know what im doing.

知道一点我在做什么。我是一个Web开发人员,所以看代码并不是所有的胡言乱语,但试图使用Xcode是一本新书给我。无论如何,我设计了一个游戏,编译在C + +使用SFML在Windows上,现在我们试图把它带到OS X(我是唯一的一组与Mac)。

Thats a lie, I know a bit about what I'm doing. I'm a web developer so looking at code isn't all gibberish, but trying to use Xcode is a new book for me. Anyway, I designed a game that was compiled in C++ using SFML on Windows, and now we are trying to bring it over to OS X (I am the only one of the group with a Mac).

使用Xcode 4.6.1和SFML 2.0我一直在试图让这个应用程序构建,到目前为止只是头痛。这个事情的工作状态不是那么糟糕,它终于建立没有错误,但生成停止,并显示:

Using Xcode 4.6.1 and SFML 2.0 I've been trying to get this damn application to build, and so far it's been nothing but headaches. The current state of getting this thing to work is not so bad, it finally builds with no errors but the build stops and this shows up:

dyld: Library not loaded: @executable_path/../Frameworks/freetype.framework/
Versions/A/freetype

Referenced from: /Users/Eric/Library/Developer/Xcode/DerivedData/
Test-haconqzbewevbwgukppsacykkpml/Build/Products/Debug/Test.app/
Contents/Frameworks/sfml-graphics.framework/Versions/2.0.0/sfml-graphics

Reason: Incompatible library version: sfml-graphics requires version 17.0.0 or
later, but freetype provides version 16.0.0

我只是不明白这个错误。我有FreeType的最新版本。我甚至不确定什么版本号是指考虑FreeType是在2.4.11。

I just dont understand this error. I have the most updated version of FreeType. I'm not even sure what that version number is referring to considering FreeType is at 2.4.11. I can't seem to find this error anywhere else either, any ideas?

推荐答案

错误消息中提及的版本号是指到库的兼容性版本。这是在构建时给定的动态库中的版本号。当另一个二进制文件链接到该库时,兼容性版本被复制到 LC_LOAD_DYLIB 加载命令,该命令在 dyld 运行时动态库需要加载。当由 dyld 加载库时,将检查兼容性版本,如果程序的版本大于库的版本,则会出错。

The version numbers mentioned in the error message refer to the compatibility version of the library. This is a version number that's baked in to a given dynamic library at the time it is built. When another binary is linked against that library, the compatibility version is copied in to the LC_LOAD_DYLIB load command that tells dyld at runtime which dynamic libraries need to be loaded. When a library is loaded by dyld, the compatibility version is checked and if the program's version is greater that the library's version, it is an error.

当你运行 otool -L freetype.framework / Versions / A / freetype 时,你会看到它报告兼容版本为 16.0.0 。如果你在 sfml-graphics.framework / Versions / 2.0.0 / sfml-graphics 上运行它,你会看到它报告兼容版本 17.0.0 freetype.framework 。所以你碰到上面描述的错误情况。

When you run otool -L freetype.framework/Versions/A/freetype you'll see that it reports its compatibility version as 16.0.0. If you run it on sfml-graphics.framework/Versions/2.0.0/sfml-graphics you'll see that it reports a compatibility version of 17.0.0 for freetype.framework. So you're hitting the error case described above.

这样的错误的最常见的原因是运行你的应用程序对比旧版本的框架构建它,和任何链接框架,反对。注意,在这个意义上,较老是指兼容性版本,而不是与框架相关联的任何其他版本号(例如,营销版本)。

The most common cause of an error like this is running your application against an older version of a framework than the version you built it, and any linked frameworks, against. Note that "older" in this sense refers to the compatibility version and not any other version number associated with the framework (e.g., the marketing version).

的两个框架(例如,如果你自己构建它们,或者你有二进制文件),它不是完全明显你错了。但我会注意到,SFML git存储库似乎有一个版本 freetype.framework 以及相应的兼容性版本( 17.0.0 ),因此如果您使用一个由SFML人提供的 sfml-graphics.framework 的二进制文件,然后拾取它们的FreeType框架可能是你的解决方案。

Without knowing the origin of the two frameworks involved (e.g., if you built them yourself, or where you got the binaries from), it's not completely obvious where you've gone wrong. I will note however that the SFML git repository appears to have a version of freetype.framework with the appropriate compatibility version (17.0.0), so if you're using a binary of sfml-graphics.framework provided by the SFML folks then picking up their FreeType framework may be your solution.

这篇关于在XCode中构建FreeType错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆