title: SOIL OpenGL Library crashes inside classes
body: <p>I'm working on a simple 3D model loader using OpenGL and I wanted to add texture support. However, not wanting to needlessly rewrite an image library, I downloaded SOIL (Simple OpenGL Image Library) that I learned about in the NeHe tutorial on texture mapping. It has a few very useful functions that take care of loading images of many times and passing them to OpenGL.</p>
  
  <p>The problem is this: In the NeHe tutorial code, the SOIL function     </p>
  
  <pre><code>SOIL_load_OGL_texture(char *, param,param,param) 
  </code></pre>
  
  <p>exactly as promised and the polygons are mapped with the correct picture. However, I've made a class that loads OBJ and MTL files (3D model files). When I try to use the SOIL function to load a texture  inside this class, my program crashes.</p>
  
  <ul>
  <li>I am using GNU C++ with Code::Blocks (I also tried this code in Dev-C++)</li>
  <li>I receive no errors or warnings from the compiler with -g -Wall.</li>
  <li>I have linked and included everything properly in my project (if I copy/paste the NeHe code, it runs properly).</li>
  <li>The SOIL command does not work inside any class (I tried making another class that only executed the SOIL function and I got the same problem).</li>
  <li>The file paths passed to the function are all correct. I have tried relative and absolute, with all formats of forward and back slashes. I copied and pasted absolute paths that worked in the NeHe code to my code and it does not work.</li>
  <li>The rest of my code works fine - I can get my shape rendered with its ambient/diffuse/etc. colors and other settings applied properly.</li>
  </ul>