c++ - 无法在 Windows 上编译 SQLCipher

标签 c++ c sqlite sqlcipher

我正在尝试编译 SQLCipher。我已经从http://sqlcipher.net/下载了源代码。 然后我从这篇文章中做: [http://groups.google.com/group/sqlcipher/browse_thread/thread/55c6296b56bf4533:][1]

[1] 我安装了 MinGW(将路径设置为 gcc:d:\MinGW\bin)、OpenSSL 和 ActiveState Perl。我将文件 libeay32.dll 复制到 sqlcipher 目录。然后我尝试执行这个命令:

./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC
-I/path/to/openssl/include" LDFLAGS="-leay32"

我得到了错误:

checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See 'config.log' for more details.

Config.log 显示:

configure:2537: $? = 0
configure:2544: gcc -v >&5
Using built-in specs.
COLLECT_GCC=D:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=d:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.2 (GCC) 
configure:2548: $? = 0
configure:2555: gcc -V >&5
gcc.exe: '-V' option must have argument
configure:2559: $? = 1
configure:2582: checking for C compiler default output file name
configure:2604: gcc -DSQLITE_HAS_CODEC -l/d/OpenSSL-Win32/bin  -libeay32 conftest.c  >&5
**d:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -ld:/OpenSSL-Win32/bin
d:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -libeay32**
collect2: ld returned 1 exit status

我不知道什么是-leay32。我将文件 libeay32.dll 复制到 sqlcipher 目录。在D中有目录OpenSSL-Win32。

谢谢

最佳答案

尝试一下您的配置命令:

./configure –disable-tcl CFLAGS=”-DSQLITE_HAS_CODEC –Ic:/path/to/openssl/include –Lc:/path/to/openssl/lib –leay32”

-leay32 是一个库标志,因此可以将其想象为“-l eay32”。它被称为“eay32”,因为库标志忽略“libeay32”的“lib”。

关于c++ - 无法在 Windows 上编译 SQLCipher,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8098499/

相关文章:

mysql - 有没有办法让查询遵循 SQL 中的层次结构?

c++ - 指针引用可能检测到内存泄漏?

c++ - 读取整数的程序,只要它们交替为正负。 C++

c++ - 在容器中使用 placement new

c++ - 使用 native Windows API 的 win32 线程安全队列实现

c - 获取 UDP 目标地址 :Port from TPROXY'd Traffic

java - 值没有插入到 SQLite 数据库

vb.net - SQLite,是否打开一个永久连接?

c - 计算结果为零并可用作语句的函数宏

ios - 创建大小为 "x"的文件以与 mmap 等一起使用的正确方法