![](/img/trans.png)
[英]On creation of a new file it shows “<SFML/Graphics.hpp> no such file or directory”
[英]Compiler can't find SFML/Graphics.hpp, but it is added to includedirs
我已經開始研究游戲引擎,您可以在https://github.com/SapphireOmega/MarbleEngine上找到其源代碼。 我使用premake5設置了項目。 我嘗試使用sfml,但在Windows和linux上都沒有嘗試過macos(我沒有嘗試過macos),但顯示錯誤消息“ SFML / Graphics.hpp”。
我嘗試了許多不同的方法,但是沒有一個成功。 目前,我在MarbleEngine / vendor // SFML中具有sfml文件,並且已在游戲引擎本身的MarbleEngine項目和示例項目Sandbox項目中都添加了包含路徑的路徑,但仍出於某種原因找不到。
在下面,您可以找到將路徑添加到includedirs的一行示例
includedirs { "%{prj.name}/vendor/linux/SFML/include" }
我建議您查看github回購中的完整項目和代碼
Visual Studio給出以下錯誤消息: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory
我希望它可以正常工作並進行編譯,因為SFML / Graphics.hpp的路徑在includedirs中,但是似乎無法找到它。
您必須將正在使用的.dll添加到項目中。 最簡單的方法是將它們添加到.exe所在的位置。 你做過/嘗試過嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.