我有一个错误,我不知道如何解决。
我使用 VS2012 创建了一个简单的程序来测试 SOIL(来自 SOIL 网站的示例代码):
#include "SOIL.h"
#include <iostream>
#include <glew.h>
#include <freeglut.h>
int main() {
std::cout << "Started" << std::endl;
/* load an image file directly as a new OpenGL texture */
GLuint tex_2d = SOIL_load_OGL_texture
(
"img.png",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
);
/* check for an error during the load process */
if( 0 == tex_2d )
{
printf( "SOIL loading error: '%s'\n", SOIL_last_result() );
}
}
我得到错误:
Unhandled exception at 0x585727FF (msvcr110d.dll) in imageLib.exe: 0xC0000005: Access violation reading location 0x00000000.
任何帮助表示赞赏。谢谢你。