我正在尝试在我的Mac操作系统上使用SFML而不使用Xcode,并已完成非IDE安装。我正在按照这个教程进行操作:https://www.sfml-dev.org/tutorials/2.0/start-linux.php 它是Linux安装页面,但似乎适用于在MacOS终端上进行操作。
我有一个CPP目录,其中包含我的example.cpp文件,在该目录中,我有一个“Resources”文件夹,其中存放了SFML资源。然而,我的终端出现了“Library not loaded”错误,我已经在网络上搜索过一些信息,但仍然遇到了很多麻烦。我已添加了Homebrew中的“freetype”,但似乎不起作用。我还确保告诉动态链接器可以找到SMFL库。
el-nino:CPP Home$ g++ -std=c++11 -IResources/SFMLR/include -c example.cpp
el-nino:CPP Home$ g++ example.o -o sfml-app -LResources/SFMLR/lib -lsfml-graphics -lsfml-window -lsfml-system
el-nino:CPP Home$ ./sfml-app
dyld: Library not loaded: @rpath/../Frameworks/freetype.framework/Versions/A/freetype
Referenced from: /Users/Home/Desktop/Junk_Code/CPP/Resources/SFMLR/lib/libsfml-graphics.2.4.2.dylib
Reason: image not found
Abort trap: 6