Hello,
I've been using SFML (1.6) on Windows for a while now and I love it!
However, I'm having trouble setting it up in Linux (ubuntu 11.10). I
m facing two problems.
I downloaded the latest 2.0 version from github, ran cmake and make to build the libraries. The first problem that I encountered is that I can't seem to make the libsfml-XXX-s-d.a files. For instance, I have libsfml-system.so,libsfml-system.so.2.0,libsfml-system-d.so,libsfml-system-d.so.2.0 and sfmlsystem-d.a.
I find this strange, I did configure with CMake in Debug with BUILD_SHARED_LIBS disabled prior to running make, I tried it again in case I forgot to ran make with this configuration but still no *-s-d.a files.
Next, when I try to compile the code below, it gives me the following errors:
Compiling: src/main.cpp
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp: In function ‘int main(int, char**)’:
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp:11:12: error: ‘class sf::Window’ has no member named ‘IsOpened’
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp:14:16: error: ‘class sf::Window’ has no member named ‘GetEvent’
/home/robvleugel/Dev/Projects/XML Test/src/main.cpp:21:77: error: ‘sf::Key’ has not been declared
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings
I hope anyone knows a solution for my problems.
Keep up the good work!
Greetings, Rob
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main(int argc, char** argv) {
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
// Window closed
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key pressed
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}
}
return 0;
}