How to cross compile from Linux for Windows
How to cross compile from Linux for Windows
Hello, I created a build for windows without shared libraries. Now when I try to compile the samples with the provided make file I get an exe. But it does not run on windows because some libgcc_s_seh-1.dll is missing. So how can I compile those samples via the terminal command line or how should I modify the make files so those exe files run on windows? Thank you very much!
Re: How to cross compile from Linux for Windows
As you did not provide any concrete information about your build, I assume you just built wxWidgets statically, with SHARED=0 or omitting SHARED parameter at all.
But you still need the compiler DLLs. So either you copy the DLL to the same folder your application executable is or build wxWidgets and the application to link to the compiler libraries statically as well.
I do not know how to do it on Linux, but on MSW with GCC makefile, you would pass the linker flags to GCC with
for example like this
EDIT
It seems you already dealt with this before?
viewtopic.php?f=19&t=46893&start=15#p197234
But you still need the compiler DLLs. So either you copy the DLL to the same folder your application executable is or build wxWidgets and the application to link to the compiler libraries statically as well.
I do not know how to do it on Linux, but on MSW with GCC makefile, you would pass the linker flags to GCC with
Code: Select all
LDFLAGS="-static"
Code: Select all
mingw32-make -f makefile.gcc SHARED=0 CXXFLAGS="-std=c++17" LDFLAGS="-static"
It seems you already dealt with this before?
viewtopic.php?f=19&t=46893&start=15#p197234
Re: How to cross compile from Linux for Windows
Yeah, I put the missing libs next to the CXXFLAGS in ine makefile, but it does not seem to work anymore.It seems you already dealt with this before?
Edit. I just combined the first answer with the libs like that
Code: Select all
x86_64-w64-mingw32-g++ *.cpp -o out.exe `PATH/TO/wxIDGETS/build_win/wx-config --cxxflags` `PATH/TO/wxIDGETS/build_win/wx-config --libs` -static-libgcc -static-libstdc++
Code: Select all
$(wx-config --cxxflags --libs)