Jump to content

  • Log In with Google      Sign In   
  • Create Account


Problems with SDL & OpenGL in Dev-C++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 The Magical Pot   Members   -  Reputation: 178

Like
0Likes
Like

Posted 11 October 2012 - 11:51 AM

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.

Sponsor:

#2 Faelenor   Members   -  Reputation: 396

Like
0Likes
Like

Posted 11 October 2012 - 02:29 PM

Aren't you just missing a -lopengl in your linker options? Also, I guess "lobopengl.a" is typo?

#3 Pointer2APointer   Members   -  Reputation: 283

Like
0Likes
Like

Posted 11 October 2012 - 02:48 PM

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:

I have the "lobopengl.a" library file

You mean "libopengl.a"?

What does the linker error say?

Edited by Pointer2APointer, 11 October 2012 - 02:56 PM.

Yes, this is red text.

#4 mhagain   Crossbones+   -  Reputation: 7816

Like
0Likes
Like

Posted 11 October 2012 - 03:30 PM

Dev-C++


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: http://clicktobegin....ldnt-use-dev-c/

I don't know why the linker complains.


See first part of my answer.

Edited by mhagain, 11 October 2012 - 03:31 PM.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS