Include stb
时间: 2024-02-10 19:47:20 浏览: 57
这是一个库文件,它提供了一些轻量级且易于集成的 C/C++ 函数,可以用于处理图像、音频等数据。这个库的全称是 "Sean Barrett's libraries"。在使用这个库时,需要在代码中包含对应的头文件,例如在处理图片时,可以包含 "stb_image.h" 文件,这个文件中包含了一些函数,可以用来加载各种格式的图片文件。
相关问题
我的头文件是这样写的#include <stdio.h> #include <math.h> #include <fstream> #include <iostream> #include <string>//getline #include <sstream> #include "stb_image.h" #pragma comment(lib, "openGL32.lib") #pragma comment(lib, "glu32.lib") #pragma comment(lib, "glaux.lib") #include <gl/glaux.h> #include "glew.h" #include "glut.h" #include <vector>,请问如何避免报错gl.h included before glew.h呢
在你的头文件中,应该将 `glew.h` 的引入放在 `gl.h` 的引入之前。因此,你应该将 `glew.h` 的引入语句移到 `gl.h` 的引入语句之前,就像这样:
```
#include <stdio.h>
#include <math.h>
#include <fstream>
#include <iostream>
#include <string>//getline
#include <sstream>
#include "stb_image.h"
#include <gl/glaux.h>
#include <vector>
#include "glew.h"
#include <gl/glut.h>
#pragma comment(lib, "openGL32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")
```
这样就能够避免 `gl.h included before glew.h` 的错误了。
导入stb_image.h编译提示 3 | #include <stb_image.h> | ^~~~~~~~~~~~~ compilation terminated.
你在导入stb_image.h时遇到了编译错误。这个错误提示是在第3行的#include <stb_image.h>处出现的。根据你提供的引用内容,可以看出正确的导入方式应该是#include "stb_image.h",而不是#include <stb_image.h>。请尝试将#include <stb_image.h>改为#include "stb_image.h",然后重新编译你的代码。
阅读全文
相关推荐















