Advertisement

NeHe Tuts on Dev-C++

Started by February 26, 2002 01:28 PM
10 comments, last by algumacoisaqualquer 22 years, 7 months ago
Hello, I've downloaded the some lessons from the NeHe tutorials and i was trying to compile it on the Dev-C++, but the line
  
if (ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)
   
doesen't compile, giving me the error: 153 c:\dev-c_~1\downlo~1\lvc__~1\lesson01\lesson1.cpp `CDS_FULLSCREEN' undeclared (first use this function) does anybody know what can I do? I supose it should be something like a # include, but I have no idea. Thank you! Edited by - algumacoisaqualquer on February 26, 2002 2:33:37 PM
The answer is in this thread http://www.gamedev.net/community/forums/topic.asp?topic_id=72807
Advertisement
Easy to solve...

    #define DISP_CHANGE_SUCCESSFUL      0#define CDS_FULLSCREEN              0x00000004 


Just add those two lines in your source and it'll compile fine..



Coding is easy - All it consists of is moving blocks of memory back and forth - the trick is to know which part of memory to move, and where to move it!


Edited by - Rickmeister on February 26, 2002 2:46:36 PM
Thanks for the quick reply!

It kind of worked... it will give me 0 errors, but it isn''t compiling... now it gives me on the linker:
c:\dev-c++\meusinhos\opennehelesson1.o(.text+0x38):opennehelesson: undefined reference to `glViewport@16''
c:\dev-c++\meusinhos\opennehelesson1.o(.text+0x45):opennehelesson: undefined reference to `glMatrixMode@4''
c:\dev-c++\meusinhos\opennehelesson1.o(.text+0x4d):opennehelesson: undefined reference to `glLoadIdentity@0''

(i''m not going to put all the undefined references because there are a lot of them, but you can get the idea)
Well, I guess I''ll have to dig a little more to see if I can solve this - I''ve had the same kind of problem a lot of times before.
You need to link with the openGL libraries.
I''m not sure if I have done that...
#include <windows.h>
#include <stdio.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
this is what I have when Starting the code. Anyway, it worked now, my friend told me to include -lopengl32 -lglaux -lglu32 on the object files (evilclown - perhaps was that what you were tolding me to do), in the project options. Other tutorials still don''t work, (the piece of code free(TextureImage[0]->data); generates an error because of the free funcion, as well as other functions), but I guess that''s because these funcions are declared by VC++ internaly, so I''ll have to find out what''s the librery or reference to include.
Anyway, thanks for the help, I''ll try to play with that a little more before bothering again.
Advertisement
Include stdlib at the top and place those libraries in the linkage options. I''m not sure if I should be bothered by you not taking the time to search for previous answers to these questions or Jeff for not repairing his tutorials (maybe he has?) to get around the non-linking errors.

Thanks Null and Void, it worked...
Than I got an error saying I didn't had the Glaux.dll. I searched for it in the internet, but couldn't find it. Then I tried searching it on the foruns Search engine, and I found SOOO many people saying they were trying the NeHe tutorials on DevC++ and couldn't find the Glaux.dll and things like that... and in almost everyone of there was a message by you: "Glaux sucks. It leacks memory, is outdated and the company that made it says it's better to use GLUT insted". Well, I guess I learned that I should use the search engine a little more often...
I now have my bitmap loading program however... supported by a 1.3 Megabytes Dll...
thanks again...

Edited by - algumacoisaqualquer on February 26, 2002 8:32:16 PM
If you don''t want to use GLaux (as you''ve seen I advise to not to):
  • Use another library (like you said you''re doing I think)
  • Skin to tutorial #25 (it shows you how to write your own basic Targa loader)
  • Write your own bitmap loader (potentially based off of Jeff''s Targa loader).

  • Do this: go into your dev-c++ directory and look under Examples. There should be an openGL example. Then you need to link with this
    -lopengl32 -glu32 

    This topic is closed to new replies.

    Advertisement