I want to learn SFML and I've tried loads of different tutorials but I just get errors with everything I put into it, whether I copy it and type it or if I paste it.
My code:
#include <SFML/Window.hpp>
int main()
{
sf::Window window;
window.create(sf::VideoMode(640,480), "Window");
while(window.isOpen())
{
sf:Event event;
while(window.pollEvent(event))
{
if(event.type = sf::Event::Closed)
window.close();
}
}
return 0;
}
Errors:
g++ -c main.cpp
main.cpp: In function ‘int main()’:
main.cpp:6:9: error: ‘class sf::Window’ has no member named ‘create’
window.create(sf::VideoMode(640,480), "Window");
^
main.cpp:7:15: error: ‘class sf::Window’ has no member named ‘isOpen’
while(window.isOpen())
^
main.cpp:9:6: error: ‘Event’ was not declared in this scope
sf:Event event;
^
main.cpp:9:6: note: suggested alternative:
In file included from /usr/include/SFML/Window.hpp:34:0,
from main.cpp:1:
/usr/include/SFML/Window/Event.hpp:197:7: note: ‘sf::Event’
class Event
^
main.cpp:9:12: error: expected ‘;’ before ‘event’
sf:Event event;
^
main.cpp:10:16: error: ‘class sf::Window’ has no member named ‘pollEvent’
while(window.pollEvent(event))
^
main.cpp:10:26: error: ‘event’ was not declared in this scope
while(window.pollEvent(event))
^
main.cpp:13:11: error: ‘class sf::Window’ has no member named ‘close’
window.close();
^
Have I installed it wrong or am I missing something?