【问题标题】:Cygwin gcc 4.8.3 version fails to makeCygwin gcc 4.8.3版本制作失败
【发布时间】:2017-11-25 11:20:36
【问题描述】:

我一直在尝试在 cygwin 上编译/制作 'gcc 4.8.3'**。我安装的cygwin版本是**cygwin x86_64。我也预装了gcc,版本是5.4.0。

为什么我想要这个特定版本的 gcc 是因为,我需要安装 Python3.5.2,这样我才能反过来在 cygwin 上安装 tensorflow。我尝试使用 Pyenv 安装 Python3.5.2,但我的猜测是 Python 3.5.2 的库是用 gcc 4.8.x 版本预编译的,因为我遇到了 Pyenv 无法运行 C 编译程序的问题。另外,我认为,问题可能是因为版本。我使用的是 64 位的 windows 10。

gcc 的配置成功发生,但我在运行 make 文件时遇到了问题。这是错误信息:

          checking how to run the C++ preprocessor... /lib/cpp
          configure: error: C++ preprocessor "/lib/cpp" fails sanity check
          See `config.log' for more details.
          make[2]: *** [Makefile:4763: configure-stage1-gmp] Error 1
          make[2]: Leaving directory 
          '/cygdrive/c/softwares/cygwin64/lib/gcc_4_8_3'
          make[1]: *** [Makefile:20946: stage1-bubble] Error 2
          make[1]: Leaving directory 
          '/cygdrive/c/softwares/cygwin64/lib/gcc_4_8_3'
           make: *** [Makefile:890: all] Error 2

我检查了 config.log,这是我发现的:

           /usr/include/sys/cdefs.h:45:20: fatal error: stddef.h: No such 
           file or directory
           #include <stddef.h>
                ^
           compilation terminated.
           configure:12120 $? = 1
           configure: failed program was:

            | /* confdefs.h.  */
            | #define PACKAGE_NAME "GNU MP"
            | #define PACKAGE_TARNAME "gmp"
            | #define PACKAGE_VERSION "4.3.2"
            | #define PACKAGE_STRING "GNU MP 4.3.2"
            | #define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org"
            | #define PACKAGE "gmp"
            | #define VERSION "4.3.2"
            | #define WANT_FFT 1
            | #define HAVE_HOST_CPU_none 1
            | #define PROTOTYPES 1
            | #define __PROTOTYPES 1
            | #define STDC_HEADERS 1
            | #define HAVE_SYS_TYPES_H 1
            | #define HAVE_SYS_STAT_H 1
            | #define HAVE_STDLIB_H 1
            | #define HAVE_STRING_H 1
            | #define HAVE_MEMORY_H 1
            | #define HAVE_STRINGS_H 1
            | #define HAVE_INTTYPES_H 1
            | #define HAVE_STDINT_H 1
            | #define HAVE_UNISTD_H 1
            | #define HAVE_STRING_H 1
            | #define HAVE_DLFCN_H 1
            | /* end confdefs.h.  */
            | #ifdef __STDC__
            | # include <limits.h>
            | #else
            | # include <assert.h>
            | #endif
            |            Syntax error

             configure:12114: g++ -E -DNO_ASM conftest.cpp
             In file included from /usr/include/features.h:12:0,
             from /usr/include/limits.h:11,
             from conftest.cpp:27:

我还在 windows 环境路径中包含了 /lib/cpp dll 文件。尽管如此,它并没有改变任何东西。

我认为这个问题是由于缺少文件造成的。我可以在哪个目录中找到这个文件?

或者是否有任何其他机制来编译 gcc。我不想使用预装的 gcc 版本,因为我打算在 cygwin 上安装 Python 3.5.2 和 tensorflow。

任何类型的帮助都会很棒。

谢谢。

【问题讨论】:

  • $ cygcheck -l gcc-core |grep stddef.h /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/stddef.h

标签: gcc g++ cygwin


【解决方案1】:

stddef.h 是 gcc 编译器的一部分

$ cygcheck -l gcc-core |grep stddef.h
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/stddef.h

【讨论】:

    【解决方案2】:

    我找到了解决问题的方法。

    我已经用 apt-cyg 卸载了 cygwin Python,现在 windows 版本的 python 工作正常。

    【讨论】:

      【解决方案3】:

      仅作记录,另一种方法是使用setupx86_64.exe 安装python 并在.pyenv/versions/&lt;yourversionname&gt;/bin 中手动符号链接二进制文件:请参阅问题Pyenv fails to install python on Cygwin: ModuleNotFoundError: No module named '_ctypes'

      【讨论】:

        猜你喜欢
        • 2015-06-27
        • 2013-11-08
        • 1970-01-01
        • 2016-01-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-24
        相关资源
        最近更新 更多