适用于iPhone的Berkeley DB
问题描述:
我曾尝试为iphone OS 4创建库,但遇到了错误。
I had tried to create the library for iphone OS 4, but was getting errors.
以下是我参考Berkeley DB安装指南的构建脚本。
Here are my build scripts with reference to Berkeley DB Installation guide.
export DEV_iOS=/Developer/Platforms/iPhoneOS.platform/Developer
export SDK_iOS=${DEV_iOS}/SDKs/iPhoneOS4.2.sdk
export COMPILER_iOS=${DEV_iOS}/usr/bin
export CC=${COMPILER_iOS}/gcc
export CXX=${COMPILER_iOS}/g++
export LDFLAGS="-arch armv6 -pipe -Os -gdwarf-2 -no-cpp-precomp -mthumb -isysroot ${SDK_iOS}"
export CFFLAGS=${LDFLAGS}
export CXXFLAGS=${LDFLAGS}
../dist/configure --host=arm-apple-darwin10 --with-cryptography=no --enable-shared=no
make
这里我收到一条带有3个警告的错误消息:
Here I am getting an error message with3 warnings:
libtool: link: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -O3 -o db_archive -arch armv6 -pipe -Os -gdwarf-2 -no-cpp-precomp -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk db_archive.o util_sig.o libdb-5.1.a -lpthread
ld: warning: in db_archive.o, file was built for i386 which is not the architecture being linked (armv6)
ld: warning: in util_sig.o, file was built for i386 which is not the architecture being linked (armv6)
ld: warning: in libdb-5.1.a, file was built for unsupported file format which is not the architecture being linked (armv6)
Undefined symbols:
"_main", referenced from:
_main$non_lazy_ptr in crt1.o
(maybe you meant: _main$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [db_archive] Error 1
请指导我,我在脚本中做错了。
Please guide me, where I am doing wrong in the scripts.
谢谢提前。
答
我得到了Oracle团队的支持。
I have got Oracle team support.
I已成功创建库。
我已将其发布在我的博客上。请查看i386和armv6架构的详细构建脚本。
I have posted it on my blog. Please check the detailed build script for i386 and armv6 architectures.