|
|
Dev-C++ and openGL - linker problem and simple how to
I'm using dev-C++ version 4.9.9.0 and am trying to run a simple openGL
example found in the folder that came w/dev-c
(Dev-Cpp\Templates\OpenGL.txt)
1-I create a project , cut paste code from .txt file into main.cpp
2-Go to Project->Project Options ->Parameters -> linker section and
input (in this order): -lglut32 -lglu32 -lopengl32
3-Hit compile and get the following errors:
[Linker error] undefined reference to `GetStockObject@4'
[Linker error] undefined reference to `SwapBuffers@4'
[Linker error] undefined reference to `ChoosePixelFormat@8'
[Linker error] undefined reference to `SetPixelFormat@12'
4-I checked and have the following files:
Dev-Cpp\include\GL\gl.h
Dev-Cpp\include\GL\glu.h
Dev-Cpp\include\GL\glext.h
Dev-Cpp\include\GL\glut.h
Dev-Cpp\lib\libglut32.a
Am I missing something here?
|
|
0
|
|
|
|
Reply
|
claybox
|
11/4/2004 5:08:50 PM |
|
clay wrote:
> I'm using dev-C++ version 4.9.9.0 and am trying to run a simple openGL
> example found in the folder that came w/dev-c
> (Dev-Cpp\Templates\OpenGL.txt)
>
> 1-I create a project , cut paste code from .txt file into main.cpp
>
> 2-Go to Project->Project Options ->Parameters -> linker section and
> input (in this order): -lglut32 -lglu32 -lopengl32
>
> 3-Hit compile and get the following errors:
> [Linker error] undefined reference to `GetStockObject@4'
> [Linker error] undefined reference to `SwapBuffers@4'
> [Linker error] undefined reference to `ChoosePixelFormat@8'
> [Linker error] undefined reference to `SetPixelFormat@12'
>
> 4-I checked and have the following files:
> Dev-Cpp\include\GL\gl.h
> Dev-Cpp\include\GL\glu.h
> Dev-Cpp\include\GL\glext.h
> Dev-Cpp\include\GL\glut.h
> Dev-Cpp\lib\libglut32.a
>
> Am I missing something here?
Have you created the project by choosing "OpenGl" in the multimedia tab
? I did that with version 4.9.8.0 and had no problem.
I tried to find the same errors and did so when the Project's type is
changed to "Console" in Project Settings, General tab. It works well if
the type is set to Win32 GUI. That just adds a -mwindows flag in the
linker step.
Hope this helps
--
Vincent
|
|
0
|
|
|
|
Reply
|
Vincent
|
11/4/2004 8:59:32 PM
|
|
clay wrote:
> I'm using dev-C++ version 4.9.9.0 and am trying to run a simple openGL
> example found in the folder that came w/dev-c
> (Dev-Cpp\Templates\OpenGL.txt)
>
> 1-I create a project , cut paste code from .txt file into main.cpp
>
> 2-Go to Project->Project Options ->Parameters -> linker section and
> input (in this order): -lglut32 -lglu32 -lopengl32
>
> 3-Hit compile and get the following errors:
> [Linker error] undefined reference to `GetStockObject@4'
> [Linker error] undefined reference to `SwapBuffers@4'
> [Linker error] undefined reference to `ChoosePixelFormat@8'
> [Linker error] undefined reference to `SetPixelFormat@12'
>
> 4-I checked and have the following files:
> Dev-Cpp\include\GL\gl.h
> Dev-Cpp\include\GL\glu.h
> Dev-Cpp\include\GL\glext.h
> Dev-Cpp\include\GL\glut.h
> Dev-Cpp\lib\libglut32.a
>
> Am I missing something here?
Depends on what Dev-cpp installation you are talking about. If
you had downloaded Dev-cpp with MinGW ,(4.9.9.0) the binaries
(lib files) are not compatible with the linker distributed with Dev-cpp.
Sometimes the order of the libraries does matter. So please post
the options to the linker that it is being used and the platform
that you are running this on ?
--
Karthik. http://akktech.blogspot.com .
' Remove _nospamplz from my email to mail me. '
|
|
0
|
|
|
|
Reply
|
Karthik
|
11/4/2004 9:42:40 PM
|
|
clay wrote:
> I'm using dev-C++ version 4.9.9.0 and am trying to run a simple openGL
> example found in the folder that came w/dev-c
> (Dev-Cpp\Templates\OpenGL.txt)
>
> 1-I create a project , cut paste code from .txt file into main.cpp
>
> 2-Go to Project->Project Options ->Parameters -> linker section and
> input (in this order): -lglut32 -lglu32 -lopengl32
Try adding -lgdi32 to the link list, that might help.
|
|
0
|
|
|
|
Reply
|
Jonathan
|
11/5/2004 2:36:44 AM
|
|
|
3 Replies
503 Views
(page loaded in 0.053 seconds)
|
|
|
|
|
|
|
|
|