Adding SFML library Geany

Hello

Well, I'm using Geany as me IDE and I really like it.
But I've got a problem with binding the SFML library to it.

I know it must be done by changing 'build' settings in 'set build commands'. But what do I need to type there?
Until now no one was able to really 100% help me, I asked several forums.

Thanks for reading,
Niely
Try adding -lsfml-graphics -lsfml-window -lsfml-system ... and so on ... at the end of the build command.
It doesn't give an error and just compiles (I don't think it builds).
But this is what the terminal gives:
./geany_run_script.sh: 5: ./geany_run_script.sh: ./test: not found



What I have as build setting:
g++ -Wall -c "%f" -L "/home/Name/SFML" -lsfml-graphics -lsfml-window -lsfml-system

(It's a simple code to draw a circle).
Last edited on
Yeah that looks like a compile command. Are you sure you used/edit the right one? The build command is what you get when pressing F9 (by default). A build command should probably look something like this:

g++ -Wall -o "%e" "%f" -L "/home/Name/SFML" -lsfml-graphics -lsfml-window -lsfml-system

Note that that will only work for programs containing one source (.cpp) file.
Thanks a lot!
It compiles great now, but when I try to run this code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <SFML/Graphics.hpp>

using namespace std;
int main() {
cout<<"Test"<<endl;
sf::CircleShape circle;
circle.setRadius(150);
circle.setOutlineColor(sf::Color::Red);
circle.setOutlineThickness(5);
circle.setPosition(10, 20);
window.draw(circle);
}

It says:
Window was not declared in this scope.

How do I fix that?
I don't see window declared anywhere. You need something like sf::Window window;
Error: Window has no member named draw.
I think I'm getting close. :)
It doesn't look like sf::Window has a draw function.
http://www.sfml-dev.org/documentation/2.1/classsf_1_1Window.php

Try sf::RenderWindow instead.
http://www.sfml-dev.org/documentation/2.1/classsf_1_1RenderWindow.php

 
sf::RenderWindow window;
Last edited on
It compiles without problems/errors. But still no circle. :)
Is it maybe because of my Linux terminal?
You need to have a loop that renders your window and other stuff. Go check the SFML tutorials for details.
Topic archived. No new replies allowed.