使用Mac在CodeLite上安装SFML

时间:2018-07-15 00:42:34

标签: c++ sfml codelite

我在使用CodeLite for C ++的Mac上,正在尝试安装SFML库。我遵循了一个教程(可在此处找到https://en.sfml-dev.org/forums/index.php?topic=18820.0),并且在完成了该教程所说的所有操作后得到以下错误:

dyld: Library not loaded: @rpath/libsfml-graphics.2.5.dylib
 Referenced from: /Users/willbur/Desktop/School/CompSci142/SFML- 
Demo/Debug/SFML-Demo
 Reason: image not found
Abort trap: 6

有人知道如何解决此问题吗?我将所有.dylib文件复制到调试文件夹,但仍然收到错误。 SFML版本是2.5 MacOS Clang。

谢谢!

1 个答案:

答案 0 :(得分:0)

遇到同样的问题后,我删除了下载的SFML版本并使用Homebrew重新安装

brew install sfml

Homebrew会自动将sfml文件夹放在:

/usr/local/Cellar/sfml/{installed_version_number}/

在这里,按照与您遵循的列出的教程相同的方式设置您的项目,除了将Compiler Include Paths替换为:

/usr/local/Cellar/sfml/{installed_version_number}/include

和链接程序库搜索路径:

/usr/local/Cellar/sfml/{installed_version_numer}/lib

您还可以按照以下资源进行设置:SFML with CodeLite on Mac OS