C compiler cannot create executables - Cygwin/MiniGW - gcc

I'm trying to compile Pyaudio, (a Python module) from source, since I'm using Windows, and only 32-bit binaries are available - I need 64. Following these instructions I downloaded Cygwin, and installed every component, to be safe. Installing Portaudio, another module, is required first.
When I run CFLAGS="-mno-cygwin" LDFLAGS="-mno-cygwin" ./configure, I get the error configure: error: C compiler cannot create executables. See 'config.log' for more details. config.log has an additional line below that message: gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.
This leads me to believe that perhaps Cygwin is using the wrong compiler; the instructions are for using MinGw with Cygwin, but I never specified minigw in the process. I also wonder if there's something in the PyAudio build files that needs to be changed for 64-bit. I know nothing about C, compiling, Cygwin or MinGW, and am new to programming in general. Any ideas? Any other information I can provide?

Current versions of Cygwin gcc do not support -mno-cygwin anymore because it never really worked correctly. Instead, you should use a proper cross-compiler, which is provided by the mingw64-i686-gcc packages, then run ./configure --host=i686-w64-mingw32.

In some cases it is an antivirus that is causing problems.
I had avast and had to disable it.

Related

I installed Nim without any problem, but it gives me this error, what should I do?

I install Nim Lang but it not works. I get this errors, how can i fix? (I have completed the setup.)
Error: invocation of external compiler program failed. Sistem belirtilen dosayayi bulamiyor.
Additional info: "Requested command not found: \'gcc.exe -c -w -fmax-errors=3 -mno-ms-bitfields -I\"C:\\Program Files\\Nim Language\\lib\" -IC:\\Users\\SyTax\\Desktop -o C:\\Users\\Sytax\Desktop -o C:\\Users\\SyTax\\nimcache\\name_d\\stdlib_io.nim.c.o C:\\Users\\SyTax\\nimcache\\name_d\\stdlib_io.nim.c\'. OS error:" 2
Error;
enter image description here
Probably you only installed the first package from Nim's windows installation page. Note that there are other dependencies mentioned on that page. You may also need:
MingW compiler dependency, installed with finish.exe.
DLLs available on your system, like PCRE or OpenSSL, also available for download.
Alternatively you could try installing Nim using Scoop, which seems to be able to install both Nim and the required compiler.
The Nim compiler creates C code, so to compile your code to binary and run, you should install a C compiler. The default is GCC. In linux and mac, it comes with the system, so I am assuming you are using windows.
I am not a Windos user, but AFAIK you neet to install mingw amd gcc
http://www.codebind.com/cprogramming/install-mingw-windows-10-gcc/
http://mingw.org/

GCC not working during compiling haskell programs on Windows

I'd like to compile a Haskell project with a .cabal file under windows.
I have installed the Haskell Platform and Cygwin. One of the dependancies is time, which fail to build during the cabal install command.
The error message is the following:
checking for gcc... C:\PROGRA~1\HASKELL~1\826561~1.1\mingw\bin\gcc.exe
checking if the C compiler is working... no
configure error: C compiler cannot create executable
So I downloaded another gcc withing Cygwin that, I suppose, will work better.
However, this other question mention that the Haskell platform now uses MinGW rater than Cygwin to run GNU software.
I changed in the cabal configure file the location of gcc, but I still get the same error message (but with the new location of gcc).
So I'm a bit confused here: what is exactly the problem with gcc? Do you have any inputs on how I could continue the building of my software?
Fixed (partially) by using Stack. Building is failing but for another reason, so I'll ask another question.
Thanks again.

How to build GDB on Windows

How does one build GDB (the GNU Debugger) from source on Windows? I need to build it in order to make a build with Python support. I cannot use the one distributed with Cygwin because it has problems interpreting backslashes on Windows. What toolchains do I need for the build -- GnuWin32, MinGW, etc.? Can someone please provide step-by-step instructions on how to do this?
install (https://sourceforge.net/downloads/mingw) and configure MinGW with packages g++ gcc libc6-dev libtool pkg-config
get gdb sources (I use 7.latest from https://www.gnu.org/software/gdb/) and put it into MinGW/msys/1.0 folder
run ./configure in msys shell (MinGW\msys\1.0\msys.bat)
run make and fix the following:
hypot compile error with help of this '::hypot' has not been declared
undefined constants for GetLastError function by adding #include <winerror.h> into \gdb\gdbserver\win32-i386-low.c \gdb\gdbserver\win32-low.c gdb\ser-mingw.c
I have checked build process using 7.11.1 and 7.12.1 sources
7.12.1 x32 is broken under windows
https://github.com/Alexpux/MINGW-packages/issues/1909
https://sourceforge.net/p/mingw-w64/bugs/576/

how to remedy mno cygwin error?

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.
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

MinGW GCC -- Single 32-bit and 64-bit cross-compiler?

I've downloaded MinGW with mingw-get-inst, and now I've noticed that it cannot compile for x64.
So is there any 32-bit binary version of the MinGW compiler that can both compile for 32-bit Windows and also for 64-bit Windows?
I don't want a 64-bit version that can generate 32-bit code, since I want the compiler to also run on 32-bit Windows, and I'm only looking for precompiled binaries here, not source files, since I've spent countless hours compiling GCC and failing, and I've given up for a while. :(
AFAIK mingw targets either 32 bit windows or 64 bit windows, but not both, so you would need two installs. And the latter is still considered beta.
For you what you want is either mingw-w64-bin_i686-mingw or mingw-w64-bin_i686-cygwin if you want to compile for windows 64. For win32, just use what you get with mingw-get-inst.
See http://sourceforge.net/apps/trac/mingw-w64/wiki/download%20filename%20structure for an explanation of file names.
I realize this is an old question. However it's linked to the many times the question has been repeated.
I have found, after lots of research that, by now, years later, both compilers are commonly installed by default when installing mingw from your repository (i.e. synaptic).
You can check and verify by running Linux's locate command:
$ locate -r "mingw32.*[cg]++$"
On my Ubuntu (13.10) install I have by default the following compilers to choose from... found by issuing the locate command.
/usr/bin/amd64-mingw32msvc-c++
/usr/bin/amd64-mingw32msvc-g++
/usr/bin/i586-mingw32msvc-c++
/usr/bin/i586-mingw32msvc-g++
/usr/bin/i686-w64-mingw32-c++
/usr/bin/i686-w64-mingw32-g++
/usr/bin/x86_64-w64-mingw32-c++
/usr/bin/x86_64-w64-mingw32-g++
Finally, the least you'd have to do on many systems is run:
$ sudo apt-get install gcc-mingw32
I hope the many links to this page can spare a lot of programmers some search time.
for you situation, you can download multilib (include lib32 and lib64) version for Mingw64:
Multilib Toolchains(Targetting Win32 and Win64)
By default it is compiled for 64bit.You can add -m32 flag to compile for 32bit program.
But sadly,no gdb provided,you ought to add it manually.
Because according to mingw-64's todo list, gcc multilib version is done,but gdb
multilib version is still in progress,you could use it maybe in the future.
Support of multilib build in configure and in gcc. Parts are already present in gcc's 4.5 version by using target triplet -w64-mingw32.
gdb -- Native support is present, but some features like multi-arch support (debugging 32-bit and 64-bit by one gdb) are still missing features.
mingw-64-todo-list

Resources