Click to See Complete Forum and Search --> : Setting up my PC to program OpenGL


inbugable
November 13th, 2006, 03:22 PM
Hi,
I'm trying to set up my PC, running windows XP, so i can program in OpenGL. I've got visual C++, and was following a guide to set it up so i can program OGL (im programming it in C, not C++), but having been able to compile some code i know works, i got the following error:

fatal error C1853: 'Debug\OGLtest.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)

Does anyone know what this means, and how i can fix it? I'm using the 2005 edition of visual C++ if thats of any help.

Thanks a lot for any help!
Jonny

MrViggy
November 13th, 2006, 04:31 PM
Delete the PCH file; and setup your project so that it doesn't use pre-compiled headers. (Open the "Project Properties"; select "C/C++"; select "Precompiled Headers"; and set it to "Not using precompiled headers")

Viggy

inbugable
November 13th, 2006, 04:39 PM
ah great! that error has gone, but now i've got
fatal error C1083: Cannot open include file: 'GL/glut.h': No such file or directory

.. due to the line : #include <GL/glut.h>

so i guess i need to link in the glut libraries, or maybe even download them first? do you know what i should do to sort that out?

thanks a lot for your help though :)

Mike Harnad
November 13th, 2006, 05:33 PM
You can find what you need at the OpenGL (http://www.opengl.org/) site.

inbugable
November 13th, 2006, 06:43 PM
Hi again,

I've been poking around on the openGL site, and downloaded the glut libs for windows. I used this link http://www.cs.csustan.edu/~rsc/SDSU/GLUTinstall.html to try to put all the files into the right places, but i cant find the last part on my version of Visual C++, the part about:

5. First thing you need to do when the project opens up is to click on the "Project" menu item from the top.

6. Chose "Settings" (a window will come up)

7. On the left side of the window there are tabs, chose the "Link" tab

8. The string field labeled "Object/library modules" has a few lib files already set in it

9. Go to the end of this string field and enter:

opengl32.lib glut32.lib glu32.lib


which i guess is vital? If someone can tell me where that is in visual C++ 2005 thatd be cool, maybe itl finally work then!

thanks for any help!

inbugable
November 14th, 2006, 05:40 AM
does anyone have any ideas? I've been trying to sort this out for so long..

MrViggy
November 14th, 2006, 11:31 AM
Well, if it's anything like VS 7.1:

"Project"->"{project name} Properties" then select "Linker" on the left pane; then select "Input" and add the libs to the "Additional Dependencies" line.

Viggy

inbugable
November 14th, 2006, 07:10 PM
Hi again, and thanks again for the help!

I've got this error now (i added the names to the linker part like you said)

fatal error C1083: Cannot open include file: 'GL/glu.h': No such file or directory

and that is reported about the file \opengl\gl\glut.h, which is a file that i placed as told by the guide. I'm really confused! I dont understand why it wouldnt work.. have you got any more ideas? thanks again for your help :)

inbugable
November 15th, 2006, 12:25 PM
Ok it seems im just not going to get Visual C++ working.. Does anyone have any other suggestions as to how i can set up my Windows XP machine so i can program Open GL programs in C?

Mike Harnad
November 15th, 2006, 01:21 PM
Make sure you add the OpenGL path to the list of VC++ include directories. In VC8 it's found under Tools/Options/Pojects and Solutions/VC++ Directories.

inbugable
November 18th, 2006, 07:47 AM
Hi again,

I added the paths, didnt change anything. The error seems to be when looking for GL/gl.h which is inside glut.h (a file i added to numerous folders as instructed by the tutorial) . If i comment this line out, i get huge numbers of errors, and no where in all the stuff i downloaded did it make reference to this missing gl.h file. any more ideas? I'm absolutely stuck, and wasting so much time while i could be doing my assignment.. wish it was easy.
thanks for any help though, really appreciate it.

Mike Harnad
November 20th, 2006, 08:35 AM
Change the order of #includes. Make sure the OpenGL stuff is close to the top of your includes within a source file.