I'm on x64 Windows 8 and I want to release an binary without dll's.
I was learning DirectX (9), using Code::Blocks (13) and the 32-bit MinGW-build (4.8) with -lpthread.
I build an standard Code::Blocks DirectX 9 project. Edited to 32-bits for both x86 and x64 and run. Ok. Then I said for my friend run it on his 64-bit computer, but he got 2 library errors: "libgcc_s_dw2-1.dll" and "libwinpthread-1.dll". After that I tryed to compile from cmd and I got errors even when including -ld3d9 and -ld3dx9. Googled up and found -static-libgcc, -static-libstdc++ and -static. None work. So, what should I do? In command prompt, I tryed:
Your link paths are different on the Code::Blocks and command line versions. -L"C:\Program
Files (x86)\Microsoft DirectX SDK\lib" vs -L"C:\Program Files (x86)\Microsoft DirectX SDK\lib\x86". This matters because the calling conventions for x86_64 and x86 are different, requiring different name mangling (AFAIK, x64 uses __fastcall).
EDIT:
If you really want static libraries, from what I've seen, it is very difficult to remove the dependency winpthread, so you should look into TDM-GCC (A version of MinGW that is statically linked by default).