View Full Version : I Need some help with my compiler

07-21-2001, 12:47 PM
Hello I am new to OpenGl, by about 5 days, i have written some of my own code, but the problem i am having is that the compiler i have which is Dev-C++ 4 is not compiling my programs, it is always giving me errors for all the code i put in. its got its own opengl demo that compiles fine, but when i use the code i learned from NeHe's site it doesnt work i always get a compile error for:

532 c:\progra~1\merger~1\opengl~1\bounci~1.cpp
`CDS_FULLSCREEN' undeclared (first use this function)

and i really dont know what to do, i know c++ but i am still new to that. so i am not sure what it is. i really would like to figure this out before i go on my bike trip across america which is in a few days. so i can start working on my programs while im on the trip, im bringin my computer (but i dont have internet access that i can use cuz i wont be near any phones) well any help will be appreciated. thanks, -Levi

07-21-2001, 02:42 PM
Sounds like you didn't include windows.h.

07-21-2001, 05:11 PM
I had the same problem when I first started programming OpenGL. This problem has to do with the fact that you either:
- did not #include <windows.h>
- CDS_FULLSCREEN is not defined in your windows.h

The last was the case with me and as I understand some other people also had this problem. It's easy to solve this problem, you can either do:
- #define CDS_FULLSCREEN 4 (or something similar) in your program
- or you could put it into your windows.h along where the rest of the CDS_xxx is located

Hope this is helpful.

[This message has been edited by UnImPortant (edited 07-21-2001).]

07-21-2001, 05:52 PM
i will try that http://www.opengl.org/discussion_boards/ubb/smile.gif thanx

07-21-2001, 05:57 PM
http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/biggrin.gif

07-21-2001, 07:12 PM
CDS_FULLSCREEN is defined in winuser.h
windows.h includes winuser.h

07-22-2001, 03:05 PM
i had the same problem, and can u explain more clearly to how to fix the problem? every openGL source code i put in that i got from tutorial website and compile never work in dev C++, i dont know why.

07-22-2001, 03:12 PM
WAIT! i just fixed that problem now i got all thse linker error!
c:\windows\TEMP\cc59hzfb.o(.text+0x762):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x78a):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x7b9):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x7e1):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x7f8):lesson5.cp p: undefined reference to `glColor3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x819):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x833):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x854):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x87c):lesson5.cp p: undefined reference to `glVertex3f@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x884):lesson5.cp p: undefined reference to `glEnd@0'
c:\windows\TEMP\cc59hzfb.o(.text+0x9d8):lesson5.cp p: undefined reference to `wglMakeCurrent@8'
c:\windows\TEMP\cc59hzfb.o(.text+0xa02):lesson5.cp p: undefined reference to `wglDeleteContext@4'
c:\windows\TEMP\cc59hzfb.o(.text+0xfd4):lesson5.cp p: undefined reference to `ChoosePixelFormat@8'
c:\windows\TEMP\cc59hzfb.o(.text+0x1018):lesson5.c pp: undefined reference to `SetPixelFormat@12'
c:\windows\TEMP\cc59hzfb.o(.text+0x104e):lesson5.c pp: undefined reference to `wglCreateContext@4'
c:\windows\TEMP\cc59hzfb.o(.text+0x1094):lesson5.c pp: undefined reference to `wglMakeCurrent@8'
c:\windows\TEMP\cc59hzfb.o(.text+0x13da):lesson5.c pp: undefined reference to `SwapBuffers@4'

someone helP!
i'm using devC++4

07-22-2001, 03:46 PM
ive never used devc but it seems youre not linking to the libraries that have the opengl
stuff. with vc u will get approx the same errors if u don't link to opengl32.lib , i dont know what the opengl library for devc is but check the devc library directory for any that look like they have something to do with opengl + link with those

07-22-2001, 05:05 PM
Hola dude, well ya know what you should do, i got borland c++ 5.0 for free on their site, it works actually works.

07-23-2001, 04:50 AM
if you are having linking problems because you haven't added the opengl libraries to the compiler.

go to Projects->Settings
click on the Link tab and under the Object/library modules add the following:

opengl32.lib glu32.lib glaux.lib glut32.lib

the last two (glaux and glut32) libraries are only if you are using the now defunct auxillary library and glut, respectively.