SFML community forums
Help => General => Topic started by: Marfi on June 06, 2020, 04:43:22 pm
-
Hello to everyone.
I'm having issues when trying to static link.
I'm using this version of sfml 2.5.1 and
g++ --version
g++ (MinGW.org GCC-6.3.0-1) 6.3.0
if I try to compile with dynamic link everything is going fine
g++ -g main.cpp -I"e:\SFML-2.5.1\include" -o main.exe -L"e:\SFML-2.5.1\lib" -lsfml-graphics-d -lsfml-window-d -lsfml-system-d -lopengl32 -lwinmm -lgdi32
but if I try to static link
g++ -DSFML_STATIC -g main.cpp -I"e:\SFML-2.5.1\include" -o main.exe -L"e:\SFML-2.5.1\lib" -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lopengl32 -lwinmm -lgdi32
I have got:
e:\SFML-2.5.1\lib/libsfml-system-s-d.a(Err.cpp.obj): In function `sync':
D:/Programming/C++/Releases/_Sources/SFML/src/SFML/System/Err.cpp:87: undefined reference to `_imp____acrt_iob_func'
collect2.exe: error: ld returned 1 exit status
Can anyone point me what I'm doing wrong?
-
Did you build SFML yourself?
-
no, I took from: https://www.sfml-dev.org/files/SFML-2.5.1-windows-gcc-7.3.0-mingw-32-bit.zip
-
Well the big red box on the download page isn't just for decoration ;)
The compiler versions have to match 100%!
Here are links to the specific MinGW compiler versions used to build the provided packages:
Your compiler version and the downloaded pre-built SFML version are not compatible.
-
Oh my gosh! I'm so ashamed. Thx for your time ;)