Windows 10:“配置:错误:C 编译器无法创建可执行文件”

问题描述 投票:0回答:0

我正在 Windows 10 上使用 MinGW 和 MSYS 构建可执行文件“SQLCipher.exe”。运行此命令时:

./configure --prefix=$(pwd)/dist --with-crypto-lib=none --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl-win32/include /c/temp/sqlcipher-master/libeay32.dll -L/c/temp/sqlcipher-master/ -static-libgcc" LDFLAGS="-leay32"

我收到以下错误:

checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/c/temp/sqlcipher-master':
configure: error: C compiler cannot create executables
See `config.log' for more details

我曾尝试在线搜索但没有成功。大多数答案都是针对 linux 系统的,或者对我不起作用。我怎样才能让它工作?一般来说,我正在尝试使用 Windows/MinGW 平台按照这些steps.

为 SQLite-DB 构建 Qt-SQL-driver-plugin 'QSQLCIPHER' 和 SQLCipher-extension

编辑: 当我刚运行

./configure
编译器工作正常。也许问题出在 falgs 上?

以下是生成的config.log:

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

It was created by sqlcipher configure 3.39.4, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --prefix=/c/temp/sqlcipher-master/dist --with-crypto-lib=none --disable-tcl CFLAGS=-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl-win32/include /c/temp/sqlcipher-master/libeay32.dll -L/c/temp/sqlcipher-master/ -static-libgcc LDFLAGS=-leay32

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

hostname = DESKTOP-57ACPIC
uname -m = i686
uname -r = 1.0.19(0.48/3/2)
uname -s = MINGW32_NT-6.2
uname -v = 2016-07-13 17:45

/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/Windows/system32
PATH: /c/Windows
PATH: /c/Windows/System32/Wbem
PATH: /c/Windows/System32/WindowsPowerShell/v1.0/
PATH: /c/Windows/System32/OpenSSH/
PATH: /c/Program Files/Microsoft SQL Server/150/Tools/Binn/
PATH: /c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/
PATH: /c/Program Files/dotnet/
PATH: /c/Program Files/nodejs/
PATH: /c/Program Files/Git/cmd
PATH: /c/Program Files/MySQL/MySQL Shell 8.0/bin/
PATH: /c/Users/Bodyanich/AppData/Local/Programs/Python/Python310/Scripts/
PATH: /c/Users/Bodyanich/AppData/Local/Programs/Python/Python310/
PATH: /c/Users/Bodyanich/AppData/Local/Microsoft/WindowsApps
PATH: /c/Users/Bodyanich/.dotnet/tools
PATH: /c/Users/Bodyanich/AppData/Local/Programs/Microsoft VS Code/bin
PATH: /c/Users/Bodyanich/AppData/Roaming/npm


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

configure:2398: checking build system type
configure:2412: result: i686-pc-mingw32
configure:2432: checking host system type
configure:2445: result: i686-pc-mingw32
configure:2486: checking how to print strings
configure:2513: result: printf
configure:2582: checking for gcc
configure:2598: found /mingw/bin/gcc
configure:2609: result: gcc
configure:2838: checking for C compiler version
configure:2847: gcc --version >&5
gcc.exe (i686-posix-dwarf-rev2, Built by MinGW-W64 project) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2858: $? = 0
configure:2847: gcc -v >&5
Using built-in specs.
COLLECT_GCC=C:\Qt\Tools\mingw491_32\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/Qt/Tools/mingw491_32/bin/../libexec/gcc/i686-w64-mingw32/4.9.1/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.9.1/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw491/i686-491-posix-dwarf-rt_v3-rev2/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw491/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw491/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw491/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw491/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw491/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf-rev2, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw491/i686-491-posix-dwarf-rt_v3-rev2/mingw32/opt/include -I/c/mingw491/prerequisites/i686-zlib-static/include -I/c/mingw491/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw491/i686-491-posix-dwarf-rt_v3-rev2/mingw32/opt/include -I/c/mingw491/prerequisites/i686-zlib-static/include -I/c/mingw491/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw491/i686-491-posix-dwarf-rt_v3-rev2/mingw32/opt/lib -L/c/mingw491/prerequisites/i686-zlib-static/lib -L/c/mingw491/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
Thread model: posix
gcc version 4.9.1 (i686-posix-dwarf-rev2, Built by MinGW-W64 project) 
configure:2858: $? = 0
configure:2847: gcc -V >&5
gcc.exe: error: unrecognized command line option '-V'
gcc.exe: fatal error: no input files
compilation terminated.
configure:2858: $? = 1
configure:2847: gcc -qversion >&5
gcc.exe: error: unrecognized command line option '-qversion'
gcc.exe: fatal error: no input files
compilation terminated.
configure:2858: $? = 1
configure:2878: checking whether the C compiler works
configure:2900: gcc -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl-win32/include /c/temp/sqlcipher-master/libeay32.dll -L/c/temp/sqlcipher-master/ -static-libgcc  -leay32 conftest.c  >&5
c:/temp/sqlcipher-master/libeay32.dll: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
configure:2904: $? = 1
configure:2942: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "sqlcipher"
| #define PACKAGE_TARNAME "sqlcipher"
| #define PACKAGE_VERSION "3.39.4"
| #define PACKAGE_STRING "sqlcipher 3.39.4"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2947: error: in `/c/temp/sqlcipher-master':
configure:2949: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_build=i686-pc-mingw32
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl-win32/include /c/temp/sqlcipher-master/libeay32.dll -L/c/temp/sqlcipher-master/ -static-libgcc'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-leay32
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_TCLLIBDIR_set=
ac_cv_env_TCLLIBDIR_value=
ac_cv_env_amalgamation_line_macros_set=
ac_cv_env_amalgamation_line_macros_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_prog_ac_ct_CC=gcc

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

ALLOWRELEASE=''
AMALGAMATION_LINE_MACROS=''
AR=''
AWK=''
BUILD_CC=''
BUILD_CFLAGS=''
BUILD_EXEEXT=''
CC='gcc'
CFLAGS='-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I/c/openssl-win32/include /c/temp/sqlcipher-master/libeay32.dll -L/c/temp/sqlcipher-master/ -static-libgcc'
CPP=''
CPPFLAGS=''
DEFS=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GREP=''
HAVE_TCL=''
HAVE_ZLIB=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LD=''
LDFLAGS='-leay32'
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MANIFEST_TOOL=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OPT_FEATURE_FLAGS=''
OTOOL64=''
OTOOL=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='sqlcipher'
PACKAGE_STRING='sqlcipher 3.39.4'
PACKAGE_TARNAME='sqlcipher'
PACKAGE_URL=''
PACKAGE_VERSION='3.39.4'
PATH_SEPARATOR=':'
RANLIB=''
RELEASE=''
SED=''
SHELL='/bin/sh'
SQLITE_OS_UNIX=''
SQLITE_OS_WIN=''
SQLITE_THREADSAFE=''
STRIP=''
TARGET_DEBUG=''
TARGET_EXEEXT=''
TARGET_HAVE_EDITLINE=''
TARGET_HAVE_READLINE=''
TARGET_READLINE_INC=''
TARGET_READLINE_LIBS=''
TCLLIBDIR=''
TCLSH_CMD=''
TCL_BIN_DIR=''
TCL_INCLUDE_SPEC=''
TCL_LIB_FILE=''
TCL_LIB_FLAG=''
TCL_LIB_SPEC=''
TCL_SHLIB_SUFFIX=''
TCL_SRC_DIR=''
TCL_STUB_LIB_FILE=''
TCL_STUB_LIB_FLAG=''
TCL_STUB_LIB_SPEC=''
TCL_VERSION=''
TEMP_STORE=''
USE_AMALGAMATION=''
USE_GCOV=''
VERSION=''
XTHREADCONNECT=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
amalgamation_line_macros=''
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'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/c/temp/sqlcipher-master/dist'
program_prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

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

/* confdefs.h */
#define PACKAGE_NAME "sqlcipher"
#define PACKAGE_TARNAME "sqlcipher"
#define PACKAGE_VERSION "3.39.4"
#define PACKAGE_STRING "sqlcipher 3.39.4"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 77
gcc compilation mingw msys
© www.soinside.com 2019 - 2024. All rights reserved.