Missing DLLs while cross-compiling

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
LsDevs
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Feb 28, 2020 8:23 am

Missing DLLs while cross-compiling

Post by LsDevs » Sun Mar 01, 2020 1:12 pm

Hi,

I try to cross-compile under Linux to Windows using the shared library.
I followed the instructions on wxWidgets wiki but while executing main out.exe I got a lot of missing DLL Errors.

Here's how I builded the library :

Code: Select all

../configure --disable-debug_flag --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu
Here's how I compile and Link :

Code: Select all

First : x86_64-w64-mingw32-g++ -c  *.cpp  *.h  $(/wxWidgets/build_win/wx-config --cxxflags)

Second : x86_64-w64-mingw32-g++ -o out.exe *.o  $(/wxWidgets/build_win/wx-config --libs) -static-libgcc -static-libstdc++
When I use wine out.exe I got these errors :

Code: Select all

002a:err:module:import_dll Library wxbase313u_gcc_custom.dll (which is needed by L"Z:\\home\\ubuntu\\test.exe") not found
002a:err:module:import_dll Library wxmsw313u_core_gcc_custom.dll (which is needed by L"Z:\\home\\ubuntu\\test.exe") not found
002a:err:module:attach_dlls Importing dlls for L"Z:\\home\\ubuntu\\test.exe" failed, status c0000135
I've tried to download and put these DLLs in the same folder as out.exe and I got more errors :

Code: Select all

002a:err:module:import_dll Library wxbase313u_gcc_custom.dll (which is needed by L"Z:\\home\\ubuntu\\main.exe") not found
002a:err:module:import_dll Library wxmsw313u_core_gcc_custom.dll (which is needed by L"Z:\\home\\ubuntu\\main.exe") not found
002a:err:module:attach_dlls Importing dlls for L"Z:\\home\\ubuntu\\main.exe" failed, status c0000135
EDIT
I located these dlls in wxWidgets/build_win/lib/

So I really don’t understand what I am missing and why the dlls are not linked correctly

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 345
Joined: Fri Nov 03, 2006 2:00 pm

Re: Missing DLLs while cross-compiling

Post by stahta01 » Sun Mar 01, 2020 5:20 pm

You need to copy the DLLs to the exe folder.
Or, add the path of the DLLs to the PATH.

Tim S.

LsDevs
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Feb 28, 2020 8:23 am

Re: Missing DLLs while cross-compiling

Post by LsDevs » Sun Mar 01, 2020 5:32 pm

stahta01 wrote:
Sun Mar 01, 2020 5:20 pm
You need to copy the DLLs to the exe folder.
Or, add the path of the DLLs to the PATH.

Tim S.
Hi Tim,
Thanks for helping.

I've already tried to copy the DLLs to the exe folder and here are the errors :

Code: Select all

wine out.exe 
0028:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\wxbase313u_gcc_custom.dll") not found
0028:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\wxbase313u_gcc_custom.dll") not found
0028:err:module:import_dll Library wxbase313u_gcc_custom.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\out.exe") not found
0028:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\wxbase313u_gcc_custom.dll") not found
0028:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\wxbase313u_gcc_custom.dll") not found
0028:err:module:import_dll Library wxbase313u_gcc_custom.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\wxmsw313u_core_gcc_custom.dll") not found
0028:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\wxmsw313u_core_gcc_custom.dll") not found
0028:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\wxmsw313u_core_gcc_custom.dll") not found
0028:err:module:import_dll Library wxmsw313u_core_gcc_custom.dll (which is needed by L"Z:\\home\\ubuntu\\Bureau\\test\\out.exe") not found
0028:err:module:attach_dlls Importing dlls for L"Z:\\home\\ubuntu\\Bureau\\test\\out.exe" failed, status c0000135
Here's my folder content :

Code: Select all

ChildPanels.o                  wxmsw313u_gl_gcc_custom.dll
main.o                         wxmsw313u_html_gcc_custom.dll
MainPanel.o                    wxmsw313u_media_gcc_custom.dll
out.exe                        wxmsw313u_propgrid_gcc_custom.dll
wxbase313u_gcc_custom.dll      wxmsw313u_qa_gcc_custom.dll
wxbase313u_net_gcc_custom.dll  wxmsw313u_ribbon_gcc_custom.dll
wxbase313u_xml_gcc_custom.dll  wxmsw313u_richtext_gcc_custom.dll
wxmsw313u_adv_gcc_custom.dll   wxmsw313u_stc_gcc_custom.dll
wxmsw313u_aui_gcc_custom.dll   wxmsw313u_webview_gcc_custom.dll
wxmsw313u_core_gcc_custom.dll  wxmsw313u_xrc_gcc_custom.dll
EDIT :

It work copying all of these DLLs to my folder :

Code: Select all

libgcc_s_seh-1.dll  libstdc++-6.dll  libwinpthread-1.dll wxmsw313u_core_gcc_custom.dll  wxbase313u_gcc_custom.dll
I don't understand why I need to copy the libgcc and libstdc++ to my folder because I linked them staticly. Is it not possible to link static libgcc and libstdc++ and shared wxWidgets ?
Also, how can I tell the compiler I want my DLLs to be loaded from a folder named /lib for example inside my app folder ?

kagi3624
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Feb 26, 2020 8:13 am

Re: Missing DLLs while cross-compiling

Post by kagi3624 » Sun Mar 01, 2020 7:55 pm

I have the same problem. Compiling in linux works perfectly..i used --disable-shared in the build configuration...but when I try to run is says libstdc++-6.dll and libgcc_s_seh-1.dll are missing.

LsDevs
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Feb 28, 2020 8:23 am

Re: Missing DLLs while cross-compiling

Post by LsDevs » Sun Mar 01, 2020 8:00 pm

kagi3624 wrote:
Sun Mar 01, 2020 7:55 pm
I have the same problem. Compiling in linux works perfectly..i used --disable-shared in the build configuration...but when I try to run is says libstdc++-6.dll and libgcc_s_seh-1.dll are missing.
Hi,

Happy to see I'm not alone ! Sorry for you.

After rebuilding and testing others configuration I got the same errors.

While compiling using -static-libgcc -static-libstdc++, it work great, but when launching out.exe it complains about wxbase313u_gcc_custom.dll.
After copying this DLL to the folder, it now complains about libgcc_s_seh-1.dll and libstdc++-6.dll.
Very strange....

Post Reply