|
|
#include "SFML/Graphics.hpp"
to #include <SFML/Graphics.hpp>
Window window(VideoMode(800, 600), "sfml");
to RenderWindow window(VideoMode(800, 600), "sfml")
using namespace sf;
from your program. I'm not very good at explaining, so you might want to check this out to see why: http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice
Line 1: This may not be the case, but might work: change #include "SFML/Graphics.hpp" to #include <SFML/Graphics.hpp> Line 5: Change Window window(VideoMode(800, 600), "sfml"); to RenderWindow window(VideoMode(800, 600), "sfml") Also, I highly recommend you exclude using namespace sf; from your program. Pretend I have two librarys included in my code. One is #include "Average.hpp" and another is #include <Maths.hpp> . Both have a function called calculate();. If you include using namespace someObject; for both librarys in your code, then try to call the calculate(); function, your compiler won't know to use the calculate(); function from Math.hpps, or Average.hpp. If you exclude using namespace std;, you can specify which object the function (or variable) belongs to. |
A sf::Window doesn't have a clear or draw method. Perhaps you meant to define an object of type sf::RenderWindow. |