I am not sure why a SFML windows does not appear when compiled and executed. I am on ubuntu, downloaded sfml from ubuntu repos. I am assuming ubuntu has the oldest version 1.6, but i am not sure on how to tell. I dont get any error messages when compiling, but no window appears.
I am compiling it via:
g++ -Wall -o "%e" "%f" -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system
under geany's IDE
#include <SFML/Graphics.hpp>
int main()
{
// Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
// Start game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
}
// Clear the screen (fill it with black color)
App.Clear();
// Display window contents on screen
App.Display();
}
return EXIT_SUCCESS;
}
now after doing that process, i get compile errors:
test.cpp: In function ‘int main()’:
test.cpp:10:16: error: ‘class sf::RenderWindow’ has no member named ‘IsOpened’
while (App.IsOpened())
^
test.cpp:14:20: error: ‘class sf::RenderWindow’ has no member named ‘GetEvent’
while (App.GetEvent(Event))
^
test.cpp:17:23: error: ‘class sf::Event’ has no member named ‘Type’
if (Event.Type == sf::Event::Closed)
^
test.cpp:18:21: error: ‘class sf::RenderWindow’ has no member named ‘Close’
App.Close();
^
test.cpp:22:13: error: ‘class sf::RenderWindow’ has no member named ‘Clear’
App.Clear();
^
test.cpp:25:13: error: ‘class sf::RenderWindow’ has no member named ‘Display’
App.Display();
^
I changed it also from IsOpened to IsOpen as the docs say, but i get the same erros