使用Mac在CodeLite上安装SFML

Installing SFML on CodeLite using Mac

本文关键字:安装 SFML CodeLite Mac 使用      更新时间:2023-10-16

我在Mac上使用CodeLite for C++,正在尝试安装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

有人知道怎么解决这个问题吗?我将所有.dlib文件复制到调试文件夹中,但仍然收到错误。SFML版本是2.5 MacOS Clang。

谢谢!

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

brew install sfml

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

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

从这里开始,按照与所列教程中相同的方式设置您的项目,只是将编译器包含路径替换为:

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

和链接库搜索路径:

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

您也可以使用此资源进行设置:在Mac OS 上使用CodeLite的SFML