简体   繁体   English

MinGW找不到glfw3.h

[英]MinGW can't find glfw3.h

Ello, 埃洛,

I have been struggling with this problem for some time now, and after much searching, trial, and error, I come here. 我已经为这个问题苦苦挣扎了一段时间,经过大量的搜索,尝试和错误,我来到了这里。 I want to use GLFW for a project, so I made a simple main.cpp file. 我想对项目使用GLFW,所以我做了一个简单的main.cpp文件。 In it, is the code 其中是代码

#include <GLFW/glfw3.h>
#include <iostream>

int main() {


    return 0;


}

Simple enough. 很简单。 just to test if it is included is all. 仅测试它是否包含在内。

However, when I try to compile this code in MinGW, I get the error: 但是,当我尝试在MinGW中编译此代码时,出现错误:

main.cpp:1: GLFW/glfw3.h: No such file or directory

In the project folder are the files main.cpp , glfw3.dll , and the folder named GLFW that contains the files glfw3.h and glfw3native.h . 在项目文件夹中是文件main.cppglfw3.dll和名为GLFW的文件夹,其中包含文件glfw3.hglfw3native.h

the GLFW folder is also inside the MinGW include folder, and both libglfw3.a and libglfw3dll.a are present inside the MinGW lib folder. GLFW文件夹也位于MinGW include文件夹中,而libglfw3.alibglfw3dll.a都位于MinGW lib文件夹中。

Text Editor: Notepad++ 文字编辑器:记事本++

OS: Windows 8 64-bit 操作系统:Windows 8 64-bit

Compiler: MinGW32 4.8.1 编译器:MinGW32 4.8.1

I figured the problem may lie in me using the 32-bit version of GLFW, but I planned on the project being 32-bit anyway. 我认为问题可能出在我使用的是32位版本的GLFW上,但是无论如何我计划将项目设置为32位。 I don't know whether MinGW is 32 or 64 bit. 我不知道MinGW是32位还是64位。

Please help. 请帮忙。

Solved my own problem. 解决了我自己的问题。

Turns out, I didn't have C-make, nor GnuWin32. 原来,我没有C-make,也没有GnuWin32。 Apparently, these were needed for non-Visual Studio compiling. 显然,非Visual Studio编译需要这些。 Along with the suggestion Rishikesh made, and after I added the programs into both the System, and User, Environment Variables, I'm now able to compile properly. 连同瑞诗凯诗(Rishikesh)提出的建议,将程序添加到“系统”和“用户,环境变量”中之后,现在可以正确进行编译了。 Thanks for you all's help! 谢谢大家的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM