I want to compile a simple Windows application on Linux using MinGW.
I compile as follows:
x86_64-w64-mingw32-g++ -L. -l:mathlib.dll -o fib main.cpp mathlib.h
This results in an executable fib that computes the N'th fibonacci number using a function imported from mathlib.dll.
Now, when executing fib on Windows, it complains that libgcc_s_seh-1.dll and libstdc++-6.dll are missing.
If I copy these DLLs to Windows, then everything works, but I'd like not to copy these MinGW dependencies with every executable.
How can I statically link these MinGW depencies, such that foo depends on no other DLLs than mathlib.dll?