🔒 Locked
OpenGL and dev-cpp
Advertisement
Original Post
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
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
example.o(.text+0x11a):example.cpp: undefined reference to
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.
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.
here are the errors I get:
(compiler errors)
c:\documents and settings\kyle\my documents\devc++\test.cpp: In 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
(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
CDS_FULLSCREEN = 4. (undefined in non-ms) That should clear up one error! I think there are dev-c++ ports on nehe, too.
I downloaded the dev-cpp version and thats the errors I get.
just do
#ifndef CDS_FULLSCREEN
#define CDS_FULLSCREEN 4
#endif
and all will be good.
-~-The Cow of Darkness-~-
#ifndef CDS_FULLSCREEN
#define CDS_FULLSCREEN 4
#endif
and all will be good.
-~-The Cow of Darkness-~-
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement