安装 mingw-w64-v7:配置错误

Posted

技术标签:

【中文标题】安装 mingw-w64-v7:配置错误【英文标题】:installing mingw-w64-v7 : configuration error 【发布时间】:2020-01-07 11:34:08 【问题描述】:

我正在尝试在 Windows 10 mingw-w64-v7 上安装。所以我从 sourceforge 下载源代码并尝试在我的计算机上编译它们。但它不起作用。

命令 ./configure 给我:

./configure
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking whether to build the headers... yes
checking whether to build the crt... yes
checking whether to build the optional libraries... no
checking whether to build the optional tools... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
=== configuring in mingw-w64-headers (/c/Users/Guillaume/Documents/build/mingw-w64-v7.0.0/mingw-w64-headers)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking for a sed that does not truncate output... /usr/bin/sed
checking whether to rebuild headers with widl... no
checking whether to build a w32api package for Cygwin... no
checking for c-runtime headers... yes
checking for optional sdk headers... ddk,directx
checking if installing idl files is enabled... no
checking default _WIN32_WINNT version... 0x502
checking default msvcrt... msvcrt (0x700)
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating crt/_mingw.h
config.status: creating config.h
=== configuring in mingw-w64-crt (/c/Users/Guillaume/Documents/build/mingw-w64-v7.0.0/mingw-w64-crt)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking for sysroot... /usr/local
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... (cached) gawk
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... none
checking dependency style of gcc... none
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking how to run the C preprocessor... gcc -E
checking for ranlib... ranlib
checking for dlltool... dlltool
checking for ar... ar
checking the archiver (ar) interface... ar
checking dependency style of gcc... none
checking for as... as
checking whether to build a w32api package for Cygwin... no
checking whether to build the Win32 libraries... yes
checking whether to build the Win64 libraries... no
checking whether to build the WinARM32 libraries... no
checking whether to build the WinARM64 libraries... no
checking whether to use genlib... no
checking whether to enable globbing... no
checking whether to enable private exports... no
checking whether to enable delay import libs... no
checking what to provide as libmsvcrt.a... msvcrt-os
checking whether to enable experimental features... no
checking whether the compiler supports -municode... no
checking whether the linker provides __CTOR_LIST__... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking _mingw_mac.h usability... no
checking _mingw_mac.h presence... no
checking for _mingw_mac.h... no
configure: error: Please check if the mingw-w64 header set and the build/host option are set properly.
configure: error: ./configure failed for mingw-w64-crt

我并没有真正尝试过 Windows。我需要在 Windows 上编译我的 C++17 代码。我可以做些什么来解决我的问题?

【问题讨论】:

您的问题已被问及here。 ./configure --enable-lib32 --enable-lib64 --host=x86_64-w64-mingw32 给我同样的错误,即使我先从头运行配置。 这能回答你的问题吗? Configure options for building MinGW-64 on linux-64 for linux-64 (ultimately targetting windows-64) 【参考方案1】:

最新版本的 MinGW-w64 7.0.0 和最新的 GCC 10 for Windows 可以在http://winlibs.com/找到。

【讨论】:

以上是关于安装 mingw-w64-v7:配置错误的主要内容,如果未能解决你的问题,请参考以下文章

MinGW安装与配置

cmake mingw-w64:尝试构建时出现奇怪的错误

如何安装 MinGW-w64 和 MSYS2?

C++学习笔记

使用 mingw-w64 编译 mex 的链接器错误

ubuntu32bit的系统如何配置mingw-w64的交叉编译toolchain?