SFML community forums

Help => General => Topic started by: Aster on August 02, 2013, 10:50:50 pm

Title: SFML not linking properly
Post by: Aster on August 02, 2013, 10:50:50 pm
Good day,
I switched to SFML 2.1 today (which was apparently a bugfix). All I did was essentially a drop-in replacement of the SFML files (include folders, .a files and .dll files).

Before describing my error, I'm specify that I'm on Windows 7 x64 with MinGW 4.8.1 DW2 x32.

So, I compiled myself, replaced the files, then went ahead to compile my jam project, only to get
C:\Users\Aster\AppData\Local\Temp\ccXM3Mrx.o:main.cpp:(.text+0x9c): undefined reference to `_imp___ZN2sf6SpriteC1Ev'
For every single SFML thing I use, I get this error. From every module.

I compile with this:
g++ -std=c++11 -Wall -lsfml-graphics -lsfml-window -lsfml-system main.cpp Game/Game.cpp -osfml-jam

I've tried using SFML's precompiled binaries. I upgraded MinGW from 4.8.0 to 4.8.1. I rebooted.

I have no idea why this is happening, any help would be greatly appreciated. Thanks!
Title: Re: SFML not linking properly
Post by: eXpl0it3r on August 02, 2013, 11:31:56 pm
You need to specify the source code files first and then link against the libraries. ;)
Title: Re: SFML not linking properly
Post by: Aster on August 02, 2013, 11:32:55 pm
Aaah, right! I don't know how many times I've fallen for that! Thanks so much!