This topic is now archived and is closed to further replies.


This topic is 6109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here''s a snippet of code (e.g. the line where it''s problematic)

/* begin code */

// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
if (ChangeDisplaySettings(&dmScreenSettings, CBS_FULLSCREEN )!=DISP_CHANGE_SUCCESSFUL)

/* end code */

Share this post

Link to post
Share on other sites
In the current distrubution of Dev-C++, CDS_FULLSCREEN is undefined. You need to define it yourself, so at the top of your source type this:


Then recompile, the code should work fine.

Share this post

Link to post
Share on other sites
Even better! thanks for yr reply, but i have bad news:

c:\windows\TEMP\ccfLu9fb.o(.text+0x1bb):lesson2.cpp: undefined reference to `glVertex3f@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0x1d9):lesson2.cpp: undefined reference to `glVertex3f@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0x1e1):lesson2.cpp: undefined reference to `glEnd@0''
c:\windows\TEMP\ccfLu9fb.o(.text+0x1f9):lesson2.cpp: undefined reference to `glTranslatef@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0x206):lesson2.cpp: undefined reference to `glBegin@4''
c:\windows\TEMP\ccfLu9fb.o(.text+0x224):lesson2.cpp: undefined reference to `glVertex3f@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0x23b):lesson2.cpp: undefined reference to `glVertex3f@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0x259):lesson2.cpp: undefined reference to `glVertex3f@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0x27e):lesson2.cpp: undefined reference to `glVertex3f@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0x286):lesson2.cpp: undefined reference to `glEnd@0''
c:\windows\TEMP\ccfLu9fb.o(.text+0x3b8):lesson2.cpp: undefined reference to `wglMakeCurrent@8''
c:\windows\TEMP\ccfLu9fb.o(.text+0x3e2):lesson2.cpp: undefined reference to `wglDeleteContext@4''
c:\windows\TEMP\ccfLu9fb.o(.text+0x9b4):lesson2.cpp: undefined reference to `ChoosePixelFormat@8''
c:\windows\TEMP\ccfLu9fb.o(.text+0x9f8):lesson2.cpp: undefined reference to `SetPixelFormat@12''
c:\windows\TEMP\ccfLu9fb.o(.text+0xa2e):lesson2.cpp: undefined reference to `wglCreateContext@4''
c:\windows\TEMP\ccfLu9fb.o(.text+0xa74):lesson2.cpp: undefined reference to `wglMakeCurrent@8''
c:\windows\TEMP\ccfLu9fb.o(.text+0xdba):lesson2.cpp: undefined reference to `SwapBuffers@4''

Share this post

Link to post
Share on other sites
Make sure all of the OpenGL libs are included in your project. I don''t remember how to do that for Dev C++ (it''s been a while since I used it), but I know there''s a way .

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
Resist Windows XP''s Invasive Production Activation Technology!

Share this post

Link to post
Share on other sites
c:\dev-c++\opengl\lesson2.o(.text+0x9b4):lesson2.cpp: undefined reference to `ChoosePixelFormat@8''
c:\dev-c++\opengl\lesson2.o(.text+0x9f8):lesson2.cpp: undefined reference to `SetPixelFormat@12''
c:\dev-c++\opengl\lesson2.o(.text+0xdba):lesson2.cpp: undefined reference to `SwapBuffers@4''

these are the errors after i included all the files in my project. are there any other thingies i should d/l for opengl?

i have gl.h, glaux.h, and glu.h in my includes currently.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
They are in the GDI library that you links to if you create a window GUI app or whatever the IDE calls it. From the command line would it be the -mwindows switch.

Share this post

Link to post
Share on other sites
Hm...hey guys, my dev-c++ compiler wont reflect changes in the code when i recompile it.

first, it would''nt change the color of the square in lesson 2.
then i changed the "fullscreen or not?" messagebox text and it did''nt change that when i ran it.

how do i fix this?

Share this post

Link to post
Share on other sites
dev-c++ doesn''t recompile automaticaly your project. In fact, it''s just running the .exe file that is already there. You must use a ''compile'' command instead of a simple ''run''. I don''t remember the exact label of the command since i''m using visual c++ now.

Alexandre Cossette

Share this post

Link to post
Share on other sites
A bug I found with Dev'C++ was if you compile a file and it works (say you named it "Hello") and then you use a modified version but called it "Hello There" it still uses the original file (exe), this is what happened to me. If you name the file something completely different and try it maybe it'll work.

As for you compiling stuff, I have this at the top of my prog'

#include windows.h
#include stdlib.h
#include stdio.h
#include fstream.h
#include gl\gl.h
#include gl\glu.h
#include gl\glaux.h
#include mmsystem.h
#include math.h
(Put <, and > around you headers obviously)

Although you won't need all them, if you include them in your file and see if it then works you'll know that you need to include one of them. And don't forget that when adding your libs in Dev'C++ (under project options, "further object file" I think) that you put an 'l' before the lib
"-lopengl32 -lglu32 -lglaux -lwinmm" etc, or if by chance you wanted to use the Fmod sound lib (which I use, so I thought I'd mention it) , in the add libs place you put
"-Directory/libfmod.a" which comes with the package.

Edited by - Clouds3000 on March 24, 2001 6:48:05 PM

Share this post

Link to post
Share on other sites