Linux mingw32 sfml cross-compilation for windows - missing dll files

I am compiling my C ++ project as follows:

/usr/bin/i686-w64-mingw32-g++ -g -std=c++0x -Wall -I /home/bluszcz/dev/win64/SFML-2.1/include -L /home/bluszcz/dev/win64/SFML-2.1/lib -static-libgcc -static-libstdc++ -static -O4 -c src/game.cpp -o src/game.a -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio 

However, when I try to run my exe file, I get an error message about missing DLL files:

 bluszcz@zendo ~/dev/win32/builds/magicwizard $ wine mw.exe err:module:import_dll Library libgcc_s_dw2-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-system-2.dll") not found err:module:import_dll Library libgcc_s_sjlj-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\libstdc++-6.dll") not found err:module:import_dll Library libwinpthread-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\libstdc++-6.dll") not found err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-system-2.dll") not found err:module:import_dll Library sfml-system-2.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-audio-2.dll") not found err:module:import_dll Library libgcc_s_dw2-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-audio-2.dll") not found err:module:import_dll Library libgcc_s_sjlj-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\libstdc++-6.dll") not found err:module:import_dll Library libwinpthread-1.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\libstdc++-6.dll") not found err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\bluszcz\\dev\\win32\\builds\\magicwizard\\sfml-audio-2.dll") not found 

I compiled using static parameters - so why does it ask for libgcc_s_dw2-1.dll, for example?

I also copied several files there, but the application still does not see them.

 bluszcz@zendo ~/dev/win32/builds/magicwizard $ ls *dll libsndfile-1.dll sfml-audio-2.dll sfml-graphics-d-2.dll sfml-system-2.dll sfml-window-d-2.dll libstdc++-6.dll sfml-audio-d-2.dll sfml-network-2.dll sfml-system-d-2.dll openal32.dll sfml-graphics-2.dll sfml-network-d-2.dll sfml-window-2.dll bluszcz@zendo ~/dev/win32/builds/magicwizard $ 

And some files, such as libgcc_s_dw2-1.dll , do not exist at all on my file system ...

To sum up:

  1. Why doesn't my application see missing files?
  2. How to compile in a static way with mingw32?
  3. How to get the missing files?

I use this version of the sfml library to compile it: http://www.sfml-dev.org/download/sfml/2.1/SFML-2.1-windows-gcc-4.7-mingw-32bits.zip

+7
source share
3 answers

Answering only the last of three questions:

In the standard libraries, I managed to copy them from the mingw folder:

 cp /usr/lib/gcc/i686-w64-mingw32/5.3-win32/libstdc++-6.dll ./ 

However, when I copied the wrong directory according to my build (e.g. / usr / lib / gcc / x86_64-w64-mingw32 / 5.3-posix / libstdc ++ - 6.dll), I still had the same error at the time like a file with the same name was here.

0
source

On my Fedora 26 after installing mingw64-gcc and mingw64-gcc-g++ :

 [ leo@pc ]$ locate libgcc_s_seh-1.dll /usr/x86_64-w64-mingw32/sys-root/mingw/bin/libgcc_s_seh-1.dll [ leo@pc ]$ locate libstdc++-6.dll /usr/x86_64-w64-mingw32/sys-root/mingw/bin/libstdc++-6.dll [ leo@pc ]$ 

If I copy the dll and run the wine with the generated a.out.exe file, it works.

0
source

Perhaps your application does not see the files, because it is configured in this way, and you do not need to add tags like -static to the command.

To compile static libraries you must add -s , for example -lsfml-window-s -lsfml-system-s

libgcc_s_dw2-1.dll is located in the bin folder in recent MinGW releases .

If DLLs are missing, version incompatibility is possible.

0
source

Source: https://habr.com/ru/post/971114/


All Articles