Segmentation fault at 'ilutGLLoadImage'

给你一囗甜甜゛ 提交于 2019-12-12 03:18:27

问题


Anyone happen to know why I'm getting a segmentation fault at line 2 below (this is after all my glInit stuff)? I've tried different image formats (.jpeg, .png, .bmp, all from internet). Debug tips or anything helps! If you wanna see more source, ask and I'll edit promptly.

ilutRenderer(ILUT_OPENGL);
GLuint tex1 = ilutGLLoadImage("/home/brent/Desktop/myimage.jpeg");

gdb backtrace, for what it's worth:

#0  0x00000000 in ?? ()
#1  0x021b318e in ilDetermineType (
    FileName=0x804ad84 "/home/brent/Desktop/myimage.jpeg")
    at ./../src-IL/src/il_io.c:178
#2  0x021b3290 in ilLoadImage (
    FileName=0x804ad84 "/home/brent/Desktop/myimage.jpeg")
    at ./../src-IL/src/il_io.c:2124
#3  0x003bafc2 in ilutGLLoadImage () from /usr/lib/libILUT.so.1
#4  0x08049f43 in init () at facecube.cpp:112
#5  0x0804a539 in main (argc=1, argv=0xbffff3d4) at facecube.cpp:295

Closer look at entry #1:

#1  0x021b318e in ilDetermineType (
    FileName=0x804ad84 "/home/brent/Desktop/myimage.jpeg")
    at ./../src-IL/src/il_io.c:178
    178     File = iopenr(FileName);

回答1:


Solution:

ilInit();
iluInit();
ilutRenderer(ILUT_OPENGL);
GLuint tex1 = ilutGLLoadImage("/home/brent/Desktop/myimage.jpeg");


来源:https://stackoverflow.com/questions/8351115/segmentation-fault-at-ilutglloadimage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!