12

I'm working on compiling a library in windows with GCC and Make. When I run make, I get the following error:

unrecognized command line option '-mno-cygwin'

I saw this post on SO, but it doesn't necessarily seem like the same issue, and I don't understand how to downgrade my system to a version of GCC (or Make) that supports the flag I need to use in order to compile.

Could someone please try to point me in the right direction, or if you've run into this problem offer a solution?

I'm running Windows 8.1 pro, GCC 5.4.0, make 4.2.1. I can post more info if it is necessary to help me.

Community
  • 1
  • 1
jml
  • 1,745
  • 6
  • 29
  • 55

1 Answers1

12

The current cygwin gcc compiles only for cygwin itself.

-mno-cygwin is an obsolete flag from gcc 3.x time that allowed the cygwin compiler to compile mingw (not cygwin) programs.

The switch was removed long time ago and true cross compilers

mingw64-x86_64-gcc-core
mingw64-i686-gcc-core
cygwin-mingw

were made available

Latest update:
https://sourceware.org/ml/cygwin-announce/2016-11/msg00020.html

Mark Storer
  • 15,672
  • 3
  • 42
  • 80
matzeri
  • 8,062
  • 2
  • 15
  • 16
  • Thanks. The compiler I was using was `i686-w64-mingw32-gcc` – jml Jan 12 '17 at 01:30
  • I'm having an issue calling up the newer core compiler by name with a Makefile. Can you link me to an intro on how to do this in a Makefile? – jml Jan 12 '17 at 01:36
  • 3
    Should be enough to define `CC=i686-w64-mingw32-gcc` – matzeri Jan 12 '17 at 10:09
  • To be clear: Simply dropping that command line option should be fine in an all cygwin environment? It's only a problem if you're compiling **in cygwin, for mingw**? – Mark Storer Sep 03 '19 at 20:50
  • Then, what is the equivalent to `-mno-cygwin` now? I have no clue what this switch does, but it must be in my code. My compiler is `i686-w64-mingw32-gcc`. – mercury Feb 28 '22 at 07:51
  • `i686-w64-mingw32-gcc` already behave as the old `-mno-cygwin` switch. – matzeri Feb 28 '22 at 18:53