I really dislike posting here about all my problems but I've been having this one all day.
I just get a bunch of undefined references to everything in SFML.
I'm using the latest nightly build of SFML and MinGW.
Command line:
g++ main.cpp -DSFML_STATIC -IC:\SFML\include -LC:\SFML\lib
Minimal code
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(640,480), "Test", sf::Style::Titlebar);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
}
}
No idea what's wrong, help?
You forgot -lsfml-graphics -lsfml-window -lsfml-system
g++ main.cpp -DSFML_STATIC -IC:\SFML\include -LC:\SFML\lib -lsfml-graphics -lsfml-window -lsfml-system
Thanks for that! But the thing is, now when I launch the app I get this:
The program can't start because libgcc_s_sjlj-1.dll is missing from your computer.
Edit: I've tried -static and -static-libgcc but neither worked, same error.