Cygwin: How to actually use gcc-mingw

前端 未结 4 2052
走了就别回头了
走了就别回头了 2020-12-23 09:33

Since \"gcc -mno-cygwin\" does not work anymore, I was looking for a way to get a MinGW-targeted GCC running within my Cygwin environment. (Running a MSYS environment is not

相关标签:
4条回答
  • 2020-12-23 10:06

    As you already found, you can use gcc-3 with -mno-cygwin. The other possibility is to install the 32-bit and/or 64-bit toolchains from the MinGW-w64 project, which have been packaged for Cygwin very recently and hence are available through setup.exe now. Don't be put off by the rather confusing executable names: i686-w64-mingw32-gcc is the 32-bit compiler and x86_64-w64-mingw32-gcc is the 64-bit one.

    0 讨论(0)
  • 2020-12-23 10:08

    Cygwin homepage says that "Individual packages like bash, gcc, less, etc. are released independently of the DLL.".

    Here you can find how to install gcc under cygwin, so you should also select gcc package during install not only gcc-mingw.

    0 讨论(0)
  • 2020-12-23 10:15

    Further searches revealed that the MinGW-targeted cross-compiler is not ready yet, and that one has to either use GCC v3 with -mno-cygwin, or install a cross-compiler manually (see link above)...

    0 讨论(0)
  • 2020-12-23 10:33

    After installing the MingW g++ package for Cygwin (mingw64-x86_64-gcc-g++), I also struggled to figure out how to invoke it.

    Thanks to this wiki, I found out the command was x86_64-w64-mingw32-g++. Then I did alias g++='x86_64-w64-mingw32-g++' and g++ started working as expected.

    0 讨论(0)
提交回复
热议问题