Reputation: 101
I'm trying to compile my code for a 32 bit system using CodeBlock default MinGW compiler adding the -m32 parameter, but I'm getting a lot of errors:
||=== Build: Debug in cONfuSioN (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lstdc++|
ld.exe||cannot find -lmingw32|
ld.exe||cannot find -lgcc|
ld.exe||cannot find -lgcc_eh|
ld.exe||cannot find -lmoldname|
ld.exe||cannot find -lmingwex|
ld.exe||cannot find -lmsvcrt|
ld.exe||cannot find -lpthread|
ld.exe||cannot find -ladvapi32|
ld.exe||cannot find -lshell32|
ld.exe||cannot find -luser32|
ld.exe||cannot find -lkernel32|
ld.exe||cannot find -liconv|
ld.exe||cannot find -lmingw32|
ld.exe||cannot find -lgcc|
ld.exe||cannot find -lgcc_eh|
ld.exe||cannot find -lmoldname|
ld.exe||cannot find -lmingwex|
ld.exe||cannot find -lmsvcrt|
||error: ld returned 1 exit status|
||=== Build failed: 20 error(s), 0 warning(s) (0 minute(s), 6 second(s)) ===|
EDIT: I fixed
Upvotes: 3
Views: 3272
Reputation: 141598
Most builds of mingw.org and mingw-w64 only support either 32-bit or 64-bit. There are entirely separate toolchain distributions for 32-bit target than for 64-bit target.
You can have two toolchains installed side by side, but not have one toolchain with target switches.
(I have heard of someone who did do a multi-target single toolchain distro of mingw-w64 but chances are that is not what you have got installed already).
It sounds like you have only installed a 64-bit target version. You could look into also installing a 32-bit target toolchain of mingw-w64.
Upvotes: 3