2

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

DarkoNaito_09
  • 71
  • 2
  • 12

1 Answers1

3

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.

M.M
  • 138,810
  • 21
  • 208
  • 365
  • Do you have any link to a 32bit mingw version which supports c++20? – DarkoNaito_09 Jun 19 '20 at 00:43
  • 2
    @DarkoNaito_09 I would recommend installing via MSYS2 package manager, follow [these instructions](https://stackoverflow.com/a/30071634/1505939) carefully – M.M Jun 19 '20 at 00:45
  • @DarkoNaito_09 While you are in MSYS, or later when you have more time to explore, take a look at the breadth of libraries MSYS makes available. When you find you need a library for a project, odds are good it's already built for your toolchain and ready for you to install. – user4581301 Jun 19 '20 at 01:21