I get more or less the same output. Am I missing any other flag? wineg++ -c -m32 -mno-cygwin -o test.o test.cpp wineg++ -mwindows -mno-cygwin -o test.exe.so test.o -lodbc32 -lole32 -loleaut32 -lwinspool -luuid ld: Relocatable linking with relocations from format elf32-i386 (test.o) to format elf64-x86-64 (test.k1twmC.o) is not supported winebuild: ld -r failed with status 256 winegcc: winebuild failed make: *** [test.exe.so] Error 2