Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problems starting openGL  (Read 2425 times)

0 Members and 1 Guest are viewing this topic.

pabloist

  • Newbie
  • *
  • Posts: 26
    • View Profile
Problems starting openGL
« on: December 24, 2010, 08:49:15 pm »
I'm trying to get the tutorial for openGL with SFML working (http://www.sfml-dev.org/tutorials/1.6/window-opengl.php), but I'm getting errors like
"undefined reference to `gluPerspective@32'" - I think these are linker errors?

Anyway, I've tried
Quote
-lopengl32
-lsfml-graphics-s-d
-lsfml-window-s-d
-lsfml-system-s-d
which gives the 'undefined..' errors, and

Quote
-lglu32
-lopengl32
-lsfml-graphics-s-d
-lsfml-window-s-d
-lsfml-system-s-d
which, when I try to compile, gives me an error that ld.exe has stopped working.


I am a total beginner with openGL, so I appreciate any help you can give me.

(I have Windows 7, using GNU GCC with Code::Blocks.)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Problems starting openGL
« Reply #1 on: December 24, 2010, 10:19:09 pm »
glu32 is indeed what was missing, don't know why you still get errors. But "ld.exe has stopped working" errors are usually internal errors, you can get rid of them by restarting your IDE.
Laurent Gomila - SFML developer

pabloist

  • Newbie
  • *
  • Posts: 26
    • View Profile
Problems starting openGL
« Reply #2 on: December 24, 2010, 10:53:31 pm »
Okay, I got it working.. for some reason, changing it to -lsfml-graphics-d, etc fixed it, so I guess it's a problem with the way I set up SFML? I dunno. Thanks, though.

David2010

  • Newbie
  • *
  • Posts: 4
    • View Profile
Problems starting openGL
« Reply #3 on: December 25, 2010, 07:00:20 am »
I link my sfml games with:

g++ -O3 -s -o "%e".exe "%f" -static  -lsfml-window -lsfml-system -lsfml-graphics -lsfml-audio

It works as of right now.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Problems starting openGL
« Reply #4 on: December 25, 2010, 08:02:03 am »
Quote from: "pabloist"
Okay, I got it working.. for some reason, changing it to -lsfml-graphics-d, etc fixed it, so I guess it's a problem with the way I set up SFML? I dunno. Thanks, though.
It's because static libraries can't link to other libraries. If you use the static libraries, you have to link to the libraries it uses yourself.
I use the latest build of SFML2

 

anything