4

I am trying to cross compile a software on a Linux machine targeting a Windows system using Mingw.

Baiscally in the software compilation a Python extension is built and here we have the problems:

When I run the command starting the execution of the creation of the extension:

python setup.py build_ext --compiler=mingw32

This leads at the execution of the following command:

gcc -mdll -O -Wall <options and paths>
cc: unrecognized option `-mdll'

Basically this seems due to the fact that mdll is an option supported by gcc only in the "windows" version. This made me think that the problem is that the --compiler=mingw32 option is telling python we are on a Win system.

However what I did was to try and run the very same command using my Mingw compiler:

/usr/bin/mingw32-gcc -mdll -O -Wall -DSWIG=1 <options and path>
In file included from /usr/local/python-2.7.13/include/Python.h:58:0,
                 from mathsat_python_wrap.c:125:
/usr/local/python-2.7.13/include/pyport.h:351:24: fatal error: sys/select.h: No such file or directory
 #include <sys/select.h>
                        ^
compilation terminated.

As you can see here the problem is that sys/socket.h is a POSIX/SUS header. MinGW is created to build WinAPI executables. Hence the problem is the fact that the Python used to build this extension is a unix version (has been compiled on and for linux).

Does anyone have any suggestion about it?

rakwaht
  • 3,666
  • 3
  • 28
  • 45

0 Answers0