SFML community forums
Help => General => Topic started 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.
- First, I installed the latest stable build of MinGW (20120426): http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/ (http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/)
- I built from the source of SFML 2.1 using CMake 2.8.11.2:
(http://i.imgur.com/mlz0m6U.png) - I had MinGW compile the make files ('mingw32-make' in the built folder in the console)
- Put the code from the Code::Blocks tutorial into a Main.cpp
Then I ran the following command in the console: g++ -o SFMLTest main.cpp -lsfml-window -lsfml-graphics
I received the following error:
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!
-
You forgot to link against sfml-system. You'll also make sure to link in the right order: -lsfml-graphics -lsfml-window -lsfml-system
-
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)