c++ - Windows下编译OpenGL代码出错
问题描述
我正在尝试编译一个 OpenGL 程序。
这是包含所有内容的代码部分:
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
// Usage of degrees is deprecated. Use radians for glm functions.
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "shaders.h"
我试图运行的文件被调用mytest1.cpp
,我也在shaders.h
同一个目录中。
在同一个目录中,我有一个名为'include'
And 的文件夹,其中包含两个名为 And 的子文件夹'GL'
,'glm'
其中包含程序所需的所有文件。
所以我转到目录mytest1.cpp
并输入g++ mytest1.cpp
,我得到错误:
mytest1.cpp:14:21: fatal error: GL/glew.h: No such file or directory
#include <GL/glew.h>
^
compilation terminated.
为什么会这样?我也尝试将'GL'
文件夹放在根目录中,我得到了同样的错误
解决方案
推荐阅读
- node.js - 在结帐时条纹默认卡
- c++ - GlobalAlloc 代替其他分配方式
- r - 从 R 数据帧中采样
- javascript - 使用 Dropify 删除上传的图片
- javascript - Reduce() 到状态对象 Typescript
- reactjs - 如何将媒体会话 api 与 React 集成?
- paypal - PayPal 结帐按钮 - 客户端/服务器通信
- python - “pip install”在我的 MacOS 上为所有版本的 python 安装了包
- javascript - 同一句子中具有两种不同字体大小的画布文本
- mongodb - 如何在一个本地系统中配置两台 MongoDB 服务器?