0

Trying to get cross compiling working on centos7. (I have jenkins running in that environment.) There is a lot of out of date documentation on the web for mingw. Apparently there was an answer here but is gone. The cross compilation steps are discussed here. I can do a sudo yum groupinstall -y packagename, but nothing I try works (MinGW-64 mingw-64 mingw64, MinGW64, or MinGW cross-compiler) as I have seen in various posts and forums. I also tried downloading the source but had no luck with that also as various pre-requsites are missing, and when I try and obtain them they don't exist or are the wrong version.

  • Have you tried installing using the EPEL repositories? – Timothy Martin Dec 1 '16 at 1:51
  • That's a good resource I was unaware of. I found discussion groups and some good documentation there. Thanks. I wonder why Google could not point it out? – ggb667 Dec 1 '16 at 18:04
  • @ggb667 Because as of lately google has completely abandoned search for information in favour of search for advertising. – ajeh Jun 20 '18 at 14:34
2

With the EPEL repo installed you can install mingw-w64 with:

yum install mingw64-gcc
0

Finally located a compiled binary (good enough for my purposes) that will work. Here is the 64 bit binary for linux (prebuilt, just DL, and unpack it and upload the tar to the box). You will need to create an /opt/mingw64 directory and untar the file in that directory (sudo tar -xvf ~/mingw-w64-bin_x86_64-linux_20131228.tar) for ex. https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/ http://www.blogcompiler.com/2010/07/11/compile-for-windows-on-linux/

The compiler will be /opt/mingw64/bin/x86_64-w64-mingw32-gcc instead of just gcc. The reason for this is that we should be able to pick the right gcc, even if there are multiple compilers in the PATH environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.