🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Compiling error in windows

Started by
6 comments, last by halogen64 16 years, 3 months ago
Some friends and I were working on a small game for school and we're writing the code with opengl.. problem is that the other coder in the group uses linux and I use XP.. so far we have the game rendering models on his linux machine but the damn thing won't compile in windows at all.. We've been looking on the web for the right header files needed for it for 2.0+ but haven't been able find the correct ones. can anyone tell me where i could find the code/headers needed for it to compile in windows correctly?
Advertisement
Getting started has all the information

http://www.opengl.org/wiki/index.php/Main_Page
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
We've already gotten started with the coding. All the tutorials assume you already have the header file already. the gl.h file I have gives me around 500 errors when I compile it, I was asking if anyone knew a link to an up-to-date header file
What are the specific errors that you're getting?
Compiler or linker errors?

Are you linking to OpenGL32.lib?
#ifdef WIN32_NOT_SO_LEAN
#include <windows.h>
#include <GL\gl.h>
#include <gl\glu.h>

#endif

that's what my includes look like, the errors go like this:

In file included from object.h:7,
from model.h:5,
from scene.h:4,
from game.h:4,
from VBOs.cpp:29:
C:/Dev-Cpp/include/GL/gl.h:1573: error: expected constructor, destructor, or type conversion before "void"
C:/Dev-Cpp/include/GL/gl.h:1573: error: expected `,' or `;' before "void"
C:/Dev-Cpp/include/GL/gl.h:1574: error: expected constructor, destructor, or type conversion before "void"
C:/Dev-Cpp/include/GL/gl.h:1574: error: expected `,' or `;' before "void"
C:/Dev-Cpp/include/GL/gl.h:1575: error: `WINGDIAPI' does not name a type
C:/Dev-Cpp/include/GL/gl.h:1576: error: expected constructor, destructor, or type conversion before "void"

after it gets to line 1900 of the gl.h file it starts saying that the functions like glGenTextures and glTexParameterf are undeclared and that continues for the rest of the log.

We (the Linux user and myself) are both using DevC++ as a compiler. I also tried it in VC++ and got the same errors, I found this and tried it http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=356613&SiteID=1 and it still didn't work

Edit: And yes i linked the libraries for OpenGL and glu
You'll need to be more specific. Which compiler are you using (if microsoft visual studio what version/year). We should be able to give you more help with that information.

EDIT: Sorry didn't see the previous info before.
the VC++ version I tried was 2005 Express Edition but I am mainly using DevC++
Can't speak on behalf of DevC++, but I know this worked for me with express 2005 and 2008

http://saurabhinhyd.wordpress.com/2006/11/30/opengl-and-visual-c-2005-express/

This topic is closed to new replies.

Advertisement