SFML community forums

Help => General => Topic started by: BrodyB on August 24, 2013, 09:54:52 am

Title: MinGW / SFML 2.1 - Unable to link the executable
Post by: BrodyB on August 24, 2013, 09:54:52 am
I wanted to give SFML a go-around and have spent the night going over tutorials on installing everything with MinGW. However, I've been unable to get it to work.
Then I ran the following command in the console: g++ -o SFMLTest main.cpp -lsfml-window -lsfml-graphics

I received the following error:
Quote
C:\Users\Brody\AppData\Local\Temp\ccw9a3vQ.o:main.cpp:(.text+0xe0): undefined re
ference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
collect2: ld returned 1 exit status

I'm using Windows 7.

I'm not setting things up in an IDE like Code::Blocks, but just using Sublime Text for my editing. Am I missing some key steps in the installation process?

Any help is greatly appreciated!
Title: AW: MinGW / SFML 2.1 - Unable to link the executable
Post by: eXpl0it3r on August 24, 2013, 10:23:10 am
You forgot to link against sfml-system. You'll also make sure to link in the right order: -lsfml-graphics -lsfml-window -lsfml-system
Title: Re: MinGW / SFML 2.1 - Unable to link the executable
Post by: BrodyB on August 24, 2013, 05:08:31 pm
Thanks, eXpl0i3r! That put an end to the error and now it spits out the executable.

However, the program crashes immediately when I start it up. The crash seems to stem from sfml-window-2.dll. I included the built SFML DLLs (sfml-graphics-2.dll, sfml-window-2.dll, etc) into the same folder as the executable so it has access to those things.

(http://i.imgur.com/UJHfSgn.png)