I am trying to get SFML 2.1 to work with MingW, but this is causing problems.
my compiling line in the MingW compiler:
g++ -ID:\SFML-2.1\include -LD:\SFML-2.1\lib main.cpp -lsfml-graphics -lsfml-window -lsfml-system
I am trying to link .a files (does this mean that I have to add soemthing tot eh compile line?).
The code is as follows:
when I try to compile, I get the following errors:
$ make main g++ -ID:\SFML-2.1\include -LD:\SFML-2.1\lib main.cpp -lsfml-graphics -lsfml-wind ow -lsfml-system C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0xe5): undefined r eference to `_imp___ZN2sf6StringC1EPKcRKSt6locale' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x10b): undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x147): undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15Co ntextSettingsE' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x178): undefined reference to `_imp___ZN2sf6Window5closeEv' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x18d): undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x1a4): undefined reference to `_imp___ZN2sf5Color5WhiteE' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x1ae): undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x1c0): undefined reference to `_imp___ZN2sf6Window7displayEv' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x1cf): undefined reference to `_imp___ZNK2sf6Window6isOpenEv' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x1e7): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x20e): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev' C:\Users\Junker\AppData\Local\Temp\ccapaUOM.o:main.cpp:(.text+0x235): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\J unker\AppData\Local\Temp\ccapaUOM.o: bad reloc address 0xf in section `.text$_ZN 2sf6StringD1Ev[__ZN2sf6StringD1Ev]' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation collect2.exe: error: ld returned 1 exit status make: *** [main] Error 1
what am I doing wrong? the errors say an undefined link, which means there is something (a library?) that cannot be found.
The SFML 2.1 package comes with debug and release libraries (libsfml - sd), is there something related to this?
source share