[英]configure fails with “C compiler cannot create executables”
Right now I'm trying to compile the google protocol buffers from source with MinGW but when I try: 现在我正在尝试使用MinGW从源代码编译google协议缓冲区,但是当我尝试时:
Matthew@RaRemoz-8 /e/workspace/protobuf-2.5.0
$ ./configure
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/e/workspace/protobuf-2.5.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
and the config says: This 和配置说: 这
it seems to fail around this 这似乎失败了
configure:3474: checking whether the C compiler works
configure:3496: gcc conftest.c >&5
gcc.exe: error: CreateProcess: No such file or directory
configure:3500: $? = 1
configure:3538: result: no
heres the output of -v: 这是-v的输出:
$ gcc -v helloworld.c
Using built-in specs.
COLLECT_GCC=E:\MinGW\bin\gcc.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=m
ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto
--enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++
,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-l
ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm
p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --
with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-
libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/
mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
cc1 -quiet -v -iprefix E:\MinGWmingw32/4.8.1/ helloworld.c -quiet -dumpbase hel
loworld.c -mtune=generic -march=pentiumpro -auxbase helloworld -version -o C:\Us
ers\Matthew\AppData\Local\Temp\ccVVxhTh.s
gcc.exe: error: CreateProcess: No such file or directory
anyone encountered this or can help with this? 任何人都遇到过这个问题或可以提供帮助吗?
There's something wrong with your MinGW install, or maybe it's just that your PATH environment variable isn't set up quite right. 您的MinGW安装有问题,或者只是您的PATH环境变量设置不正确。
COLLECT_GCC
indicates that gcc
is in E:\\MinGW\\bin\\gcc.exe
COLLECT_GCC
指示gcc
位于E:\\MinGW\\bin\\gcc.exe
COLLECT_GCC_OPTIONS
indicates that gcc
couldn't locate cc1.exe
, so it's trying to execute it as a simple cc1
command hoping that the system will find it by a normal PATH search. COLLECT_GCC_OPTIONS
表示gcc
找不到cc1.exe
,因此它试图将其作为简单的cc1
命令执行,希望系统可以通过常规PATH搜索找到它。 The system doesn't find it, so you get the CreateProcess
error. CreateProcess
错误。 Because the Target
that GCC is built for is mingw32
, I'd expect that cc1.exe
would be located in E:\\MinGW\\libexec\\gcc\\mingw32\\4.8.1\\cc1.exe
. Target
是mingw32
,所以我希望cc1.exe
位于E:\\MinGW\\libexec\\gcc\\mingw32\\4.8.1\\cc1.exe
。 There's something else interesting about the cc1
invocation: it specifies the option -iprefix E:\\MinGWmingw32/4.8.1/
. cc1
调用还有其他有趣的地方:它指定选项-iprefix E:\\MinGWmingw32/4.8.1/
。
I'd expect it to look like: -iprefix E:\\MinGW\\bin\\../lib/gcc/mingw32/4.8.1/
我希望它看起来像:
-iprefix E:\\MinGW\\bin\\../lib/gcc/mingw32/4.8.1/
Something is munging the -iprefix
option, but I'm not sure what. -iprefix
选项有点-iprefix
,但是我不确定。
I'd suggest reinstalling MinGW. 我建议重新安装MinGW。 As mentioned in one of my comments, I'd choose one of the following distributions since they've always installed in a straightforward manner for me.
正如我的评论中提到的那样,我选择以下发行版之一,因为它们始终以简单的方式为我安装。 I can't say the same thing for the standard MinGW distribution installer, though I hear it's been greatly improved over the past few years.
对于标准的MinGW发行版安装程序,我不能说相同的话,尽管我听说在过去几年中它已经得到了很大的改进。
nuwen.net's MinGW Distro - note that recent versions of this are 64-bit native, so it will only run on 64-bit machines and apparently will only build 64-bit binaries (distro versions before 11.0 were 32-bit native and only built 32-bit binaries). nuwen.net的MinGW Distro-请注意,此版本的最新版本是64位本机,因此它将仅在64位计算机上运行,并且显然仅会构建64位二进制文件(11.0之前的发行版是32位本机,并且仅内置32位二进制文件)。 One very nice thing about nuwen MinGW is that installation is simply unpacking the archive and setting the path appropriately.
关于nuwen MinGW的一件非常好的事情是,安装过程只是解压缩归档文件并适当地设置路径。 There's a
set_distro_paths.bat
that will add it to the path for you. 有一个
set_distro_paths.bat
会将其添加到您的路径中。 Nuwen's distribution also includes several libraries, including Boost. Nuwen的发行版还包括多个库,包括Boost。 Unfortunately C++11 threads don't seem to be supported just yet.
不幸的是,目前似乎尚不支持C ++ 11线程。
TDM MinGW - you have a choice of 32-bit or 64-bit versions. TDM MinGW-您可以选择32位或64位版本。 The 64-bit version will build either 32 or 64-bit targets.
64位版本将构建32位或64位目标。 The toolchain itself is a 32-bit build, so it doesn't need a 64-bit machine to perform the compile/link steps.
工具链本身是32位构建,因此不需要64位计算机即可执行编译/链接步骤。 Use the
-m32
option to build a 32-bit target. 使用
-m32
选项来构建32位目标。 The installer for TDM is a wizard-style installer. TDM的安装程序是向导样式的安装程序。 C++ 11 threads are supported, but Boost isn't included.
支持C ++ 11线程,但不包含Boost。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.