Visual Studio错误:glm无法打开glm\detail\glm.cpp。

huangapple go评论84阅读模式
英文:

visual studio error: glm can't open glm\detail\glm.cpp

问题

我学习OpenGL并跟随这个代码:https://github.com/JoeyDeVries/LearnOpenGL

第一章可以运行,但在引入glm后,我发现了一个错误:无法打开源代码:"glm\detail\glm.cpp":找不到文件或目录。

我的代码是:

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>

#include <shader.h>

#include <iostream>

我已经将我的 "include" 文件夹包含在解决方案资源管理器中,也在属性 - 附加包含目录中输入了我的包含目录路径。

解决方案资源管理器

附加包含目录

当我按住 "Ctrl" 键并将鼠标悬停在 "#include <glm/glm.hpp>" 上时,它会变蓝,并单击会跳转到glm代码。这可能表明我已经成功地包含了glm,但是可能出现了某些错误?

英文:

I learn opengl and follow the code in https://github.com/JoeyDeVries/LearnOpenGL

First chapter can run, but after introduce glm, I found an error: can' t open source code: "glm\detail\glm.cpp": No such file or directory.

My code is:

#include &lt;glad/glad.h&gt;
#include &lt;GLFW/glfw3.h&gt;
#define STB_IMAGE_IMPLEMENTATION
#include &lt;stb_image.h&gt;

#include &lt;glm/glm.hpp&gt;
#include &lt;glm/gtc/matrix_transform.hpp&gt;
#include &lt;glm/gtc/type_ptr.hpp&gt;

#include &lt;shader.h&gt;

#include &lt;iostream&gt;

I have included my "include" folder in solution resource manager, and I also entered my include directory path into properity - additional include directory.

solution resource manager

additional include directory

When I hold "Ctrl" key and hover my mouse on "#include <glm/glm.hpp>", it turns blue and clicking can result in jumping into glm code. So it may shows that I have include glm successfully but somewhere wrong?

答案1

得分: 0

我在Visual Studio可能犯了一个错误,我发现解决方案资源管理器中包含了两个glm.cpp,只有当我切换到解决方案视图并拖动窗口句柄以查看glm.cpp的情况时,我才发现了这个错误。
这两个glm.cpp有不同的相对路径,看起来很奇怪。
其中一个glm.cpp被双击后出现错误,所以我将其从解决方案中排除,然后就没有错误了。
总之,这只是关于Visual Studio解决方案管理的一个微小错误,与OpenGL无关。

英文:

I may be make a mistake in Visual Studio, I found two glm.cpp are included in solution resource manager, only when I switch to Solution view and drag the windows handle to see the situation of glm.cpp, then I found this mistake.
The two glm.cpp have different relative path, looks weird.
One of these two glm.cpp is double clicked and then give error, so I exclude it from solution, then no error.
All in all, it is a trival mistake about Visual Studio Solution management but no opengl.

huangapple
  • 本文由 发表于 2023年7月6日 11:02:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76625223.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定