如何在Mingw-w64下编译python2 v2.7.16(我有编译错误)

时间:2019-05-02 10:28:38

标签: python compiler-errors compilation mingw-w64 msys2

我尝试使用MINGW-packages git repo编译python2 v2.7.16:

git clone https://github.com/msys2/MINGW-packages.git

cd MINGW-packages/mingw-w64-python2

MINGW_INSTALLS='mingw32' makepkg-mingw -dLf --nocheck --skippgpcheck

我总是出现以下错误:

../Python-2.7.16/Python/random.c:247:16: warning: implicit declaration of function 'fcntl'; did you mean 'rintl'? [-Wimplicit-function-declaration]
         attr = fcntl(fd, F_GETFD);
                ^~~~~
                rintl
../Python-2.7.16/Python/random.c:247:26: error: 'F_GETFD' undeclared (first use in this function)
         attr = fcntl(fd, F_GETFD);
                          ^~~~~~~
../Python-2.7.16/Python/random.c:247:26: note: each undeclared identifier is reported only once for each function it appears in
../Python-2.7.16/Python/random.c:249:21: error: 'FD_CLOEXEC' undeclared (first use in this function); did you mean 'S_IEXEC'?
             attr |= FD_CLOEXEC;
                     ^~~~~~~~~~
                     S_IEXEC
../Python-2.7.16/Python/random.c:250:29: error: 'F_SETFD' undeclared (first use in this function)
             (void)fcntl(fd, F_SETFD, attr);
                             ^~~~~~~
make: *** [Makefile:1376: Python/random.o] Error 1
==> ERROR: A failure occurred in build().
    Aborting...```

0 个答案:

没有答案