Sign in to follow this  

Problems with SDL & OpenGL in Dev-C++

This topic is 1924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I followed a tutorial on how to use OpenGL with SDL. The in code in the tutorial works just fine on Mac with Xcode, but when I use it on Windows with Dev-C++, I get linker errors. I have the "lobopengl.a" library file in the Dev-C++ lib folder and the SDL library and header files are linked to the compiler.

My include section in main.cpp looks like this:

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_opengl.h"

The project linker looks like this

-lmingw32 -lSDLmain -lSDL
-lSDL_image

I get 1 linker error for every use of OpenGL functions/constants, I don't know why the linker complains.

Share this post


Link to post
Share on other sites
Aren't you just missing a -lopengl in your linker options? Also, I guess "lobopengl.a" is typo?

Share this post


Link to post
Share on other sites
You didn't link with OpenGL, maybe?

--> -lopengl32, -lglu32, -lglut, etc.

Try adding those above and see if it works.

Also, is the build target for a GUI window (graphical one?) rather than a console window(text one?). Be sure.

EXTRA: [QUOTE]I have the "lobopengl.a" library file[/QUOTE] You mean "libopengl.a"?

What does the linker error say? Edited by Pointer2APointer

Share this post


Link to post
Share on other sites
[quote name='The Magical Pot' timestamp='1349977913' post='4989180']
Dev-C++
[/quote]

There's your problem.

Get it off Dev-C++ first, see if the problem reproduces in a sane, modern and not-broken environment, and if so then investigate.

Essential reading: [url="http://clicktobegin.net/programming/why-you-shouldnt-use-dev-c/"]http://clicktobegin....ldnt-use-dev-c/[/url]

[quote name='The Magical Pot' timestamp='1349977913' post='4989180']
I don't know why the linker complains.
[/quote]

See first part of my answer. Edited by mhagain

Share this post


Link to post
Share on other sites
Sign in to follow this