7

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?

Turtles Are Cute
  • 3,200
  • 6
  • 30
  • 38

2 Answers2

12

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.

Yaakov
  • 1,705
  • 10
  • 10
  • Another option instead of cross compiling from the Cygwin environment is to use a native windows MinGW installation (TDM or nuwen distros are very easy to install) and use MinGW's MSYS environment to handle the `./configure` step. I assume that Pyaudio's configure step would work in MSYS. – Michael Burr Jun 20 '13 at 21:46
  • Thank you very much. This answer solved the problem I posted. I ran into other problems later in the 'python setup.py build --static-link -cmingw32' step, out of the Cygwin environment. The error was 'cc1.exe: error: unrecognized command line option '-mno-cygwin', error: command 'gcc' failed with exit status 1'. When trying without -cming32, the error changed to 'Unable to find vcvarsall.bat'. I ended up finding a binary at http://www.lfd.uci.edu/~gohlke/pythonlibs/ that allowed me to stop troubleshooting this. – Turtles Are Cute Jun 22 '13 at 13:48
0

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

Menelaos
  • 23,508
  • 18
  • 90
  • 155