微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

包含文件的编译器错误

如何解决包含文件的编译器错误

我在尝试让 Assimp 在我正在做的引擎中工作时遇到问题。我正在尝试将它添加为子模块并使用 premake 构建它,并且我设法将它作为一个项目正确地包含在解决方案中,但是我遇到了一个我无法理解的错误

错误是assimp中的某些文件给了我一个“无法包含文件”的错误,这很奇怪,因为文件在那里,下图显示了它:

enter image description here

我检查了项目的工作目录,它在'vendor/Assimp'(检查图像)中,所以它应该能够包含该文件。我假设它必须是包含目录中的内容,但我无法找到它的具体内容......有人有任何线索吗?谢谢!

在这种情况下遇到的具体错误是下一个

Error (active)  E1696   cannot open source file "contrib/zip/src/zip.h" Assimp  C:\Users\lucho.suaya\Documents\GitHub\Kaimos\KaimosEngine\vendor\Assimp\code\3MF\D3MFExporter.cpp   61

Severity    Code    Description Project File    Line    Suppression State
Error   C1083   Cannot open include file: 'contrib/zip/src/zip.h': No such file or directory    Assimp  C:\Users\lucho.suaya\Documents\GitHub\Kaimos\KaimosEngine\vendor\Assimp\code\3MF\D3MFExporter.cpp   61  

我在 Assimp 项目的 premake 文件添加的包含目录是下一个

includedirs
    {
        "include","code","code/Common","code/PostProcessing","code/AssetLib","contrib/irrXML","contrib/rapidjson/include","contrib/unzip"
    }

然后我有一个引擎项目的预制文件,我在其中编写了下一个(关于assimp):

IncludeDir["Assimp"] = "%{wks.location}/KaimosEngine/vendor/Assimp/include"
include "KaimosEngine/vendor/Assimp"   -- Includes Assimp Premake File

includedirs { "%{IncludeDir.Assimp}" }
links { "Assimp" }

解决方法

通过在项目中包含许多我没有包含的文件解决了这个问题

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。