Beginning OpenGL Game Programming to Dev-C++

Started by
9 comments, last by Yamian 19 years, 6 months ago
I got the book Beginning OpenGL Game Programming and I have Dev-C++ and Visual Studio.NET Academic and for some reason the source doesn't work on either. I got pretty close with Dev-C++. Here were my errors. ANyone wanna tell me what each one means. BTW, if you have the book, I'm trying the Simple program in chapter one. Line 1: Simple.cpp: In file included from Simple.cpp Line50: C:\Dev-Cpp\include\gl\glut.h: redeclaration of C++ built-in type ` wchar_t' Makefile.win [Build Error] [Simple.o] Error 1 I did link the .lib file just so u know.
Advertisement
I had started to go through the book with Dev-C++ but have since given up. The error you mention (w_chart overdeclaration) is not the single-point failure it appears. Once you resolve it (and it's fairly easy) you will open the floodgate to MORE errors... which when resolved will reveal MORE errors. I have already burned countless hours trying to get Dev-C++ to build even the Simple.cpp program. I have milked the Dev-C++ forum for all I could.

I now use VC6, but I can only get the book's own source code to compile when I open the included workspace/project files from the CD. Unfortunately Dev-C++ does not recognize MS Workspace or Project files except to display them as the text they are, so you can't use it.

I do wish I had the freedom to build the files on my own, but for whatever reason I get link errors and dependency errors every time. I have read many posts on here by people with the exact same issues. They are usually responded to like they have ineptly forgot to add vital header files or something equivalent... when usually, like you and I, they are trying to compile the book's own source code!

Use VC, but if you do get Dev-C++ to work, let me know.
IMO,
there is no need to compile them. I hav the book myself, and what i did was to use the book as a reference, and do the tutorials on NeHe. NeHe is way better AND its free, but book is good too.
------------ "Here lies a toppled God,His fall was not a small one,We but built his pedastle,A narrow, and a tall one" Frank Herbert (Dune:Messiah)
What platform/IDE does NeHe suggest for its tutorials?
Quote:Unfortunately Dev-C++ does not recognize MS Workspace or Project files except to display them as the text they are


In the latest version (4.9.9.0) of Dev-C++, there is a function:
File => Import => Import MS Visual C++ Project.

which works for VC++ 6.0 project (not workspace) files. It seems to work OK for me. In the case of ver 7, I needed to run the project converter from:

these guys

I'm not sure this will fix anything, but it makes getting dependencies easier.
Thanks. I'll try that with Dev-C++ and let you guys know how I make out.
Quote:Original post by WarAxe
What platform/IDE does NeHe suggest for its tutorials?


Most of the NeHe tutorials have been ported to many platforms, languages and development environments. Check the bottom of each lesson for a list of ports you can download.
I managed to get Dev-C++ and GLUT work together. Here's how:

Have these link options (order matters) (you can change them from Project Options, Parameters sheet, Linker box):
-lglut32 -lglu32 -lopengl32

Example code, works:

// empty c++ project, console application

// this removes __glutInitWithExit@12 -type linker errors
#define GLUT_DISABLE_ATEXIT_HACK

#include <windows.h>
#include <gl/glut.h> // includes gl.h & glu.h

void display(){
glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1.0,1.0,1.0);

glBegin(GL_POLYGON);
glVertex3f(0.25,0.75,0.0);
glVertex3f(0.75,0.25,0.0);
glVertex3f(0.75,0.75,0.0);
glVertex3f(0.25,0.75,0.0);
glEnd();

glFlush();
}

int main(int argc, char** argv){
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250,250);
glutInitWindowPosition(100,100);
glutCreateWindow("hello");

// display something
glutDisplayFunc(display);

// enter the GLUT main loop
glutMainLoop();

return 0;
}
Quote:Original post by Stobe
#include <windows.h>
}


This is the one that removes redeclaration of wchar_t. Forgot to mention..
I have used dev-c++ with opengl for 2 years, no problems. MingW comes preshipped with opengl already, but i never really got glut to work with it, i found sdl better anyways.

This topic is closed to new replies.

Advertisement