This compile command
g++ -o run09 main-09.cpp -lsfml-graphics -lsfml-window -lsfml-system
Is giving me this error
/tmp/ccaxb42w.o: In function `main':
main-09.cpp:(.text+0x189): undefined reference to `sf::CircleShape::CircleShape(float, unsigned long)'
collect2: error: ld returned 1 exit status
For this program
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(300, 200), "New Window");
sf::CircleShape shape(50);
shape.setFillColor(sf::Color::Red);
shape.setPosition(sf::Vector2f(150, 100));
sf::RectangleShape rectshape(sf::Vector2f(50, 50));
rectshape.setFillColor(sf::Color::Blue);
while(window.isOpen())
{
sf::Event event;
while(window.pollEvent(event))
{
switch(event.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::KeyPressed:
if(event.key.code == sf::Keyboard::Space)
{
window.setTitle("Space Pressed");
}
break;
}
}
window.clear(sf::Color::Black);
window.draw(shape);
window.draw(rectshape);
window.display();
}
return 0;
}
Any ideas?