1

I recently setup a fresh install of CentOS 8 to use the Mingw Compiler for C++ (I believe it's removed from CentOS 7).

Everything was installed as follows

yum -y groupinstall "Development Tools"
yum --enablerepo=PowerTools install mingw32-gcc
yum --enablerepo=PowerTools install mingw64-gcc

Which did give me the commands I wanted both i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc (specifically for targeting Windows builds)

I am unable to use them though because calling both on a simple cpp file gives the error

x86_64-w64-mingw32-gcc: error trying to exec 'cc1plus': execvp: No such file or directory

I can still compile for Linux with the g++ command though without any issue but what am I missing to be able to use the Mingw compilers?

UPDATE

By the way this CentOS 8 is running in Docker, I don't know if that makes a difference

TheLovelySausage
  • 4,183
  • 9
  • 30
  • 49

1 Answers1

1

You’re compiling C++ code, so the frontend is looking for the C++ compiler. mingw{32,64}-gcc only provides the C compiler, you need to install the C++ compiler too:

dnf --enablerepo=PowerTools install mingw{32,64}-gcc-c++
Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164