3

Inside a msys2 mingw64 shell, I would like to compile a software with the -m32 option in order to run in 32bit mode.

I have installed mingw-w64-x86_64-toolchain

But when I compile with -m32, I have the following errors:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/lib\libmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingw32

I am thinking of a libraries installation issue, but I do not know how to find them.

2
  • Have you tried checking the folders manually for those libraries?
    – Burgi
    Commented Aug 21, 2019 at 15:00
  • Yes searched through a few directories but couldn't find them Commented Aug 23, 2019 at 12:48

2 Answers 2

1

I used the mingw32.exe shell also under c:\msys2 Under this I installed: pacman -S mingw-w64-i686-toolchain

Using gcc -m32 from the mingw64 bash shell seems to build i386 objs, (checking with objdump) but does not link sucessfully as you saw.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Dec 27, 2021 at 20:25
1

You can use the -m32 option if you use the gcc present in c:\mysys2\mingw32\bin.

If the folder is empty currently, go in:

  1. msys console.

  2. pacman -S mingw-w64-i686-toolchain and use this command.

Refer Subsystem section of this document for more information.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .