Skip to main content
gamedev.net
🔒 Locked

OpenGL and dev-cpp

Started by kylevision 9 replies 700+ views
Original Post
kylevision
kylevision
Whenever I do the NeHe tutorial for setting up a window in OpenGL I can never get it to compile without getting about 20 errors, I know that dev-cpp comes with dev-cpp and there are no errors for calling the header files so I know thats most likely not the main problem, has this happend to anyone else? If you have an answer to my problem I would really appricate it if you could please reply to this post. Thank you for your time, Kylevision Kylevision.com
JuNC
JuNC
What are the errors you are getting?
Beer Hunter
Beer Hunter
I''m going to take a guess here. If you''re getting a bunch of these:

example.o(.text+0xe4):example.cpp: undefined reference to glGenTextures@8''
example.o(.text+0xf4):example.cpp: undefined reference to
glBindTexture@8''
example.o(.text+0x11a):example.cpp: undefined reference to glTexImage2D@36''
example.o(.text+0x130):example.cpp: undefined reference to
glTexParameteri@12''
example.o(.text+0x144):example.cpp: undefined reference to `glTexParameteri@12''


...go to Project->Project Options->Linker Options/Optional Libs or Object Files, and add:
-lopengl32 -lglu32

By the way, the above aren''t compiler errors - they''re linker errors. The code is compiling just fine.
Xiachunyi
Xiachunyi
There is an import MS Visual C function in Dev under the ''File'' menu selection. That should include all libraries for you.

Note: I have the beta, I don''t know if it is on 4.0.
Yohumbus
Yohumbus
go to the compiler options and on linker put -lopengl32 -lglu32
ASCII stupid question, get a stupid ANSI
kylevision
kylevision
here are the errors I get:
(compiler errors)
c:\documents and settings\kyle\my documents\devc++\test.cpp: In function BOOL CreateGLWindow(char *, int, int, int, bool)'':
c:\documents and settings\kyle\my documents\devc++\test.cpp:153:
CDS_FULLSCREEN'' undeclared (first use this function)
c:\documents and settings\kyle\my documents\devc++\test.cpp:153: (Each undeclared identifier is reported only once
c:\documents and settings\kyle\my documents\devc++\test.cpp:153: for each function it appears in.)

(linker errors)
g++: c:\documents and settings\kyle\my documents\devc++\test.o: No such file or directory
g++: file path prefix `C:\DOCUME~1\Kyle\MYDOCU~1\DEVC__~1\Bin\'' never used

cowsarenotevil
cowsarenotevil
CDS_FULLSCREEN = 4. (undefined in non-ms) That should clear up one error! I think there are dev-c++ ports on nehe, too.
-~-The Cow of Darkness-~-
kylevision
kylevision
I downloaded the dev-cpp version and thats the errors I get.
cowsarenotevil
cowsarenotevil
just do
#ifndef CDS_FULLSCREEN
#define CDS_FULLSCREEN 4
#endif

and all will be good.

-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-
Luya
Luya
I don''t have a problem compiling with CDS_FULLSCREEN. It may have something to do with brackets.
DirtyJuan
DirtyJuan
I am trying to work with OpenGL using Dev-Cpp v4.9.8.0. i have included all the correct .lib files in the linker but i still get an error with the gl\glaux.h. can anyone help me with this problem

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.