Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux mingw32 sfml cross compile for windows - missing dll files

I am compiling my C++ project in the following way:

/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 am getting an error 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 have compiled using static options - so why it asks for libgcc_s_dw2-1.dll for example?

Also, I copied some files there, but the application still doesn't 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, like libgcc_s_dw2-1.dll, don't exist on my file system at all...

To summarize:

  1. Why does my application not see the missing files?
  2. How to compile in static way with mingw32?
  3. How to get the missing files?

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

like image 573
bluszcz Avatar asked Jun 20 '14 17:06

bluszcz


1 Answers

The missing dll's can simply be added to your WINEPATH before running your program with wine, i.e.

export WINEPATH="/usr/x86_64-w64-mingw32/lib;/usr/lib/gcc/x86_64-w64-mingw32/7.3-posix"

!Note, your paths might be slightly different depending on the mingw version you are using.

like image 131
Wout_bb Avatar answered Oct 31 '22 16:10

Wout_bb