I want to do a static link for a project that I'm working on and I wrote this example:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow AppWindow;
sf::Event AppEvent;
AppWindow.create(sf::VideoMode(800, 600), "app");
AppWindow.setVerticalSyncEnabled(true);
while(AppWindow.isOpen())
{
while(AppWindow.pollEvent(AppEvent))
{
if(AppEvent.type == sf::Event::Closed)
AppWindow.close();
}
AppWindow.clear();
AppWindow.display();
}
return 0;
}
And then compile it with:
g++ main.cpp -static -o test -lsfml-graphics -lsfml-window -lsfml-system
After this message showed up:
/usr/bin/ld: cannot find -lsfml-graphics
/usr/bin/ld: cannot find -lsfml-window
/usr/bin/ld: cannot find -lsfml-system
collect2: error: ld returned 1 exit status
SFML is installed from the official Manjaro repo.