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

Author Topic: Getting SFML 2.0 to work in Linux  (Read 2027 times)

0 Members and 1 Guest are viewing this topic.

krisando

  • Newbie
  • *
  • Posts: 20
    • View Profile
Getting SFML 2.0 to work in Linux
« on: April 19, 2011, 06:47:47 am »
I've just spent the last 12 hours getting all the dependencies for compiling the SFML 2.0 source, the libraries are build (hopefully ok).

After including the libraries and getting many undefined function error messages, so I included these libraries into the project:
Code: [Select]
/usr/lib64/libfreetype.so
/usr/lib64/libGLEW.so
/usr/lib64/libGL.so
/usr/lib64/libGLU.so
/usr/lib64/jpeg.so


Terminal gives a process returned -1, just from this line:
Code: [Select]
sf::RenderWindow window(sf::VideoMode(800, 600, 32), "Test");

No indication of what went wrong, I'm very uncertain of which includes are required, various flags and what not for the compiler. Or I wonder if the libraries are iffy.

I also noticed with this line uncommented:
Code: [Select]
while (window.GetEvent(event))
It gives: 283|error: ‘class sf::RenderWindow’ has no member named ‘GetEvent’|

So maybe the window class is iffy?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Getting SFML 2.0 to work in Linux
« Reply #1 on: April 19, 2011, 07:35:22 am »
Did you compiled static SFML libraries? You shouldn't on Linux.

Quote
It gives: 283|error: ‘class sf::RenderWindow’ has no member named ‘GetEvent’|

It's now PollEvent. Look at the headers when the online documentation is not up-to-date ;)
Laurent Gomila - SFML developer

krisando

  • Newbie
  • *
  • Posts: 20
    • View Profile
Getting SFML 2.0 to work in Linux
« Reply #2 on: April 19, 2011, 07:55:42 am »
Just changed, didn't make a difference.

Although accidentally adding the path "/usr/lib" as a linker directory magically somehow made it now work. I have no idea why this is the case, as Windows doesn't seem to require it there.

And thanks for the change in naming ;D, It's good to know changes are so frequent, I assumed it wouldn't have changed in a week since I compiled the Windows version.
:oops:

 

anything