0

我正在使用 windows 和 mingw 设置 protubuf,它在 msys 中工作正常,直到我必须这样做:

在此处输入图像描述

作为响应,它会生成以下日志:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Protocol Buffers configure 2.4.1, which was
generated by GNU Autoconf 2.65.  Invocation command line was

  $ ./configure --prefix=C:/Users/Samuel/Downloads/MSYS-20111123/msys/home/Samuel/protobuf-2.4.1

## --------- ##
## Platform. ##
## --------- ##

hostname = SamuelsComputer
uname -m = i686
uname -r = 1.0.17(0.48/3/2)
uname -s = MINGW32_NT-6.2
uname -v = 2011-04-24 23:39

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: .
PATH: /usr/local/bin
PATH: /mingw/bin
PATH: /bin
PATH: /c/Program Files (x86)/Intel/iCLS Client/
PATH: /c/Program Files/Intel/iCLS Client/
PATH: /c/windows/system32
PATH: /c/windows
PATH: /c/windows/System32/Wbem
PATH: /c/windows/System32/WindowsPowerShell/v1.0/
PATH: /c/Program Files/Intel/Intel(R) Management Engine Components/DAL
PATH: /c/Program Files/Intel/Intel(R) Management Engine Components/IPT
PATH: /c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL
PATH: /c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT
PATH: /c/Program Files (x86)/Intel/OpenCL SDK/2.0/bin/x86
PATH: /c/Program Files (x86)/Intel/OpenCL SDK/2.0/bin/x64
PATH: /c/Program Files/Lenovo/Bluetooth Software/
PATH: /c/Program Files/Lenovo/Bluetooth Software/syswow64
PATH: /c/Program Files (x86)/QuickTime/QTSystem/


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2608: checking build system type
configure:2622: result: i686-pc-mingw32
configure:2642: checking host system type
configure:2655: result: i686-pc-mingw32
configure:2675: checking target system type
configure:2688: result: i686-pc-mingw32
configure:2731: checking for a BSD-compatible install
configure:2799: result: /bin/install -c
configure:2810: checking whether build environment is sane
configure:2860: result: yes
configure:3001: checking for a thread-safe mkdir -p
configure:3040: result: /bin/mkdir -p
configure:3053: checking for gawk
configure:3069: found /bin/gawk
configure:3080: result: gawk
configure:3091: checking whether make sets $(MAKE)
configure:3113: result: yes
configure:3261: checking for gcc
configure:3291: result: no
configure:3354: checking for cc
configure:3401: result: no
configure:3457: checking for cl.exe
configure:3487: result: no
configure:3511: error: in `/home/Samuel/protobuf-2.4.1':
configure:3514: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-mingw32
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-pc-mingw32
ac_cv_path_install='/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_make_make_set=yes
ac_cv_target=i686-pc-mingw32

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/Samuel/protobuf-2.4.1/missing --run aclocal-1.11'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /home/Samuel/protobuf-2.4.1/missing --run tar'
AR=''
AUTOCONF='${SHELL} /home/Samuel/protobuf-2.4.1/missing --run autoconf'
AUTOHEADER='${SHELL} /home/Samuel/protobuf-2.4.1/missing --run autoheader'
AUTOMAKE='${SHELL} /home/Samuel/protobuf-2.4.1/missing --run automake-1.11'
AWK='gawk'
CC=''
CCDEPMODE=''
CFLAGS=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GCC_FALSE=''
GCC_TRUE=''
GREP=''
HAVE_ZLIB_FALSE=''
HAVE_ZLIB_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
ISAINFO=''
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /home/Samuel/protobuf-2.4.1/missing --run makeinfo'
MKDIR_P='/bin/mkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='protobuf'
PACKAGE_BUGREPORT='protobuf@googlegroups.com'
PACKAGE_NAME='Protocol Buffers'
PACKAGE_STRING='Protocol Buffers 2.4.1'
PACKAGE_TARNAME='protobuf'
PACKAGE_URL=''
PACKAGE_VERSION='2.4.1'
PATH_SEPARATOR=':'
POW_LIB=''
PROTOBUF_OPT_FLAG=''
PROTOC=''
PTHREAD_CC=''
PTHREAD_CFLAGS=''
PTHREAD_LIBS=''
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
USE_EXTERNAL_PROTOC_FALSE=''
USE_EXTERNAL_PROTOC_TRUE=''
VERSION='2.4.1'
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
acx_pthread_config=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i686-pc-mingw32'
build_alias=''
build_cpu='i686'
build_os='mingw32'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='i686-pc-mingw32'
host_alias=''
host_cpu='i686'
host_os='mingw32'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/Samuel/protobuf-2.4.1/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
lt_ECHO='echo'
mandir='${datarootdir}/man'
mkdir_p='/bin/mkdir -p'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='C:/Users/Samuel/Downloads/MSYS-20111123/msys/home/Samuel/protobuf-2.4.1'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs=''
sysconfdir='${prefix}/etc'
target='i686-pc-mingw32'
target_alias=''
target_cpu='i686'
target_os='mingw32'
target_vendor='pc'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "Protocol Buffers"
#define PACKAGE_TARNAME "protobuf"
#define PACKAGE_VERSION "2.4.1"
#define PACKAGE_STRING "Protocol Buffers 2.4.1"
#define PACKAGE_BUGREPORT "protobuf@googlegroups.com"
#define PACKAGE_URL ""
#define PACKAGE "protobuf"
#define VERSION "2.4.1"

configure: exit 1

当我尝试改为执行以下命令时: 在此处输入图像描述 它的行为真的很奇怪,并且在执行后面的命令时没有给出任何反馈,然后无法识别以下代码行,它被用作测试以查看它是否有效:

#include <google/protobuf/message.h>

你能解释什么是错的以及如何解决它

编辑:

我不同意 Peter Remmers 在以下位置给出的建议:

这里

编辑2:

如果我只运行 ./configure 而不带前缀,我会得到以下信息:

msys 文本可以在这里看到

我正在运行 Windows 8 并正在编译代码块以测试它是否有效

4

2 回答 2

0

打开 msys shell 并尝试安装

mount

如果您的 MINGW 路径丢失,那么您必须设置 $PATH 变量。

尝试在子文件夹 msys/1.0/etc 中的文件 fstab 中添加以下行和一个空行

C:\MinGW   /mingw

更多细节:见这里http://www.mingw.org/wiki/Getting_Started

如果这不起作用,那么您可能缺少所需的编译器。即安装gcc编译器

于 2014-02-24T08:50:08.200 回答
0

是这样的:

configure:3261: checking for gcc
configure:3291: result: no

这意味着gccPATH 中没有。确保将 MinGW 的编译器工具链bin目录添加到 PATH。

于 2013-08-03T14:20:39.720 回答