# problems with DevC++

## Recommended Posts

i get these messages on the linker: lesson1.cpp: undefined reference to ChoosePixelFormat@8' lesson1.cpp: undefined reference to SetPixelFormat@12' only these 2 messages no more, the project parameters are: -lopengl32 -lglaux -lglu32 when i add #include <gl\glut.h> i get even more messages: lesson1.cpp: undefined reference to __glutInitWithExit@12' :lesson1.cpp: undefined reference to __glutCreateWindowWithExit@8' lesson1.cpp: undefined reference to __glutCreateMenuWithExit@8' :lesson1.cpp: undefined reference to ChoosePixelFormat@8' lesson1.cpp: undefined reference to `SetPixelFormat@12' on another projet i get this message: gcc: -lopengl32: linker input file unused since linking not done gcc: -lglaux: linker input file unused since linking not done gcc: -lglu32: linker input file unused since linking not done

##### Share on other sites
i have added: #define CDS_FULLSCREEN 0x00000004 at the beginning.
all the header files are int the gl directory, i dont know why the linker is nuts.

##### Share on other sites
it seems not to work, where are the linker options in devc?

##### Share on other sites
Project > Project Options > Parameters >
-lglu32 -lopengl32 etc

You need to make sure you have the libs somewhere Dev-C++ can find too of course. Just put the .a files in the dev C++ lib directory if you haven't already.

##### Share on other sites
You need this pack for devc++:
http://devpaks.org/details.php?devpak=4 <-- Glaux DevPak

and under parameters you need to add:
-D__GNUWIN32__ -W -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS

and under linker you need to place this:
-lopengl32 -lglu32 -lglaux -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32

Hope it works! it does for me.

##### Share on other sites
Try not to download libraries directly, I face a lot of problems when I do so as well.

Just go to "Search for updates and packages" in the menu and select "Devpaks.org" and find the required OpenGL libraries/extensions and install them, this will get installed correctly on your system. Then you can simply do something like File->New->Project->GLUT and all the parameters for OpenGL and glut will already be there in your build options.

##### Share on other sites

i have deistalled devc4 and installed devc5 then i iststlled the glaux package and the openglut package and i still get the same messages, do i need another one?

##### Share on other sites
Have you tried the parameter trick? I'm sure that works. However it immidiatly means you need to have a project file with it, create a new project, add the C/C++ file, change the parameters and try to compile.

##### Share on other sites
is there any place where i cn download all the nehe tutorials as a zip file?

##### Share on other sites
the first lessons in NeHe's tutes also have ports for a lot of languages. the ones for DevC++ work for me, try copy-pasting the linker parameters from one of the lessons to your project.

hope this helps, that's how i did it =D

##### Share on other sites
I had the exact same problems with DevC++, here's exactly what I did (in simple steps):

1. Downloaded the glaux devpack with using check for updates/packages and selected devpacks.org, and then searched for the 'glaux' file.

3. Made a new OpenGL and glaux project

4. Made sure I had the right parameters (it was missing -lglu32)

5. Found that I needed to capitalize the GL in

After doing these steps, my code compiled. Hope this helps.

##### Share on other sites
I had the exact same problems with DevC++, here's exactly what I did (in simple steps):

1. Downloaded the glaux devpack with using check for updates/packages and selected devpacks.org, and then searched for the 'glaux' file.

3. Made a new OpenGL and glaux project

4. Made sure I had the right parameters (it was missing -lglu32)

5. Found that I needed to capitalize the GL in the #include GL/glaux

After doing these steps, my code compiled. Hope this helps.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627738
• Total Posts
2978881

• 10
• 10
• 21
• 14
• 13