My friends and I are having some trouble getting a project to statically link to SFML.
I happen to have a different project that links just fine (statically). So I've been trying to figure out differences. For my computer (WindowsXP, MinGW), the issue seems to stem from making a .o.
main.cpp:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window;
return 0;
}
I can compile with this command line:
g++ -I../../include main.cpp -o test.exe -DSFML_STATIC -L../../lib/sfml -lsfml-graphics-s -lsfml-window-s -lsfml-system-s
However, if I do this:
g++ -I../../include -c main.cpp -o main.o
g++ -I../../include main.o -o test.exe -DSFML_STATIC -L../../lib/sfml -lsfml-graphics-s -lsfml-window-s -lsfml-system-s
I get link errors: Undefined reference to sf::RenderWindow
Is there something that I am missing?
Thanks