• Advertisement
Sign in to follow this  

How is it possible? (OpenIL question)

This topic is 4729 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm using the library OpenIL to load textures for my openGL project, but I'm experiencing a lot of strange bugs.... look at this (the compiler il DevC++ vers. 4.9.9.2) If I write: GLuint glImage; (declared as an object's provate member) glImage = ilutGLLoadImage(path); return 1; THIS IS NOT WORKING (segmentation fault after the return), but: GLuint glImage; (declared as an object's provate member) GLuint tmp; (declared as local to the function) tmp = ilutGLLoadImage(path); glImage = tmp; return 1; WORKS.... how is it possible??

Share this post


Link to post
Share on other sites
Advertisement
I'm not really sure why it would do that... as long as it works you can use it, I guess :D.

Cheers!

Share this post


Link to post
Share on other sites
You've got a bug elsewhere that's causing problems in this code. To throw a guess I'd suggest a wild, dangling, or null pointer. You could allways use a debugger. Try:

gdb myprogram
...
(gdb) run
...
Segmentation Fault
(gdb) bt
...

After the last command, bt, it should display a stack trace, which will help you know exactly where it's crashing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement