How to compile C code on a 64-bit Windows 7 machine using gcc 4.5.3

I am trying to compile a plugin for Stata (statistical programming language), which is written in C. Its author was able to compile it on other machines using the following commands on a 32-bit computer Windows (using Cygwin):

gcc -shared -mno-cygwin stplugin.c strgroup.c -O3 -funroll-loops -o strgroup.PC.Windows.plugin 

He was also able to compile it on a 64-bit Unix with:

 gcc -shared -fPIC -DSYSTEM=OPUNIX stplugin.c strgroup.c -O3 -funroll-loops -o "strgroup.PC (64-bit x86-64).Unix.plugin" 

And Macintosh OS X with:

 gcc -bundle -arch i386 -arch x86_64 -arch ppc -DSYSTEM=APPLEMAC stplugin.c strgroup.c -O3 -funroll-loops -o "strgroup.Macintosh.MacOSX.plugin" 

I am trying to compile it on a 64 bit Windows 7 machine using Cygwin 1.7.9-1 and gcc v4.5.3. The mno-cygwin flag gives me problems, but I can't figure out how to use the mingw-oriented cross-compiler.

+4
source share
1 answer

The -mno-cygwin option is no longer supported .

Install any of the mingw-* , mingw64-i686-* or mingw64-x86_64-* toolchain (the Devel category in Cygwin's package manager) to get the correct cross-compiler.

+1
source

Source: https://habr.com/ru/post/1394510/


All Articles