View Full Version : openGL image loading, code prob, please help!

05-15-2009, 07:32 AM
Hey all, I found really concise and small openGL JPEG image loading code example, that runs on my VS2008 no problem. I am trying to move this code into my existing program that has a brick shader (from 3dshaders.com), but I am stuck on some header error. I have been banging at it and googling it for over two hours now. Can anybody look at my Visual Studio project. I bet I am making some noob C++ mistake. The problem seems to be when I include "jpeg.h" in ogl2brick.h. It is on line 54.

Link to project: http://www.mediafire.com/file/5tmlzyz14zz/brick_2.zip

Link to original JPEG loading project: http://www.morrowland.com/apron/tut_gl.php

05-15-2009, 09:27 AM
This is not really related to Opengl... Please print the compiler output.

05-15-2009, 09:59 AM
I get 306 errors, the first one is:

Error 2 error C2143: syntax error : missing '{' before ':' C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cstdio 39 ogl2brick

The output doesn't tell much, and it all happens because of that one include statement.

05-15-2009, 11:33 AM
hem, that does not help much indeed. Put the full compiler output between code tags
. I do not have the ability to compile your project from VS.

05-15-2009, 11:55 AM
Apparently the problem was that my files were in .c, and changing them to .cpp fixed it. Now my code compiles, but try as I might, I cannot get a texture on an object using this library :(

I did however get some random bmp24 loading function to work, I even got it to texture with GLSL :)