mingw64bit can static link any library to exe, but with mingw32bit, it seems can not static link the librarys, after compiled ,the exe alse need
dll files within same folder. ex. wxbase313u_gcc810.dll, wxmsw313u_core_gcc810.dll and libgcc_s_sjlj-1.dll
How to static link librarys with mingw32bit?
Code: Select all
g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.1.3\include -IC:\wxWidgets-3.1.3\lib\gcc810_x64_dll\mswu -c C:\wx\wxApp.cpp -o obj\Release\wxApp.o
g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.1.3\include -IC:\wxWidgets-3.1.3\lib\gcc810_x64_dll\mswu -c C:\wx\wxMain.cpp -o obj\Release\wxMain.o
g++.exe -LC:\wxWidgets-3.1.3\lib\gcc810_x64_dll -o bin\wx.exe obj\Release\wxApp.o obj\Release\wxMain.o obj\Release\resource.res -s -static-libstdc++ -static-libgcc -static -mthreads -lwxmsw31u_core -lwxbase31u -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -mwindows