0

我曾尝试为 iphone OS 4 创建库,但出现错误。

这是我参考 Berkeley DB 安装指南的构建脚本。

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 个警告的错误消息:

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

请指导我,我在脚本中做错了什么。

提前致谢。

4

3 回答 3

2

对于关注此线程的任何人,您可能希望查看带有答案的实际 OTN 论坛条目,您可以在此处找到。

问候,

戴夫

于 2011-01-15T00:13:26.150 回答
2

我得到了 Oracle 团队的支持。

我已经成功地创建了库。

我已经在我的博客上发布了它。请查看 i386 和 armv6 架构的详细构建脚本。

http://ankitthakur.wordpress.com/2011/01/16/build-scripts-for-berkely-db-static-libraries-with-ios-development/

于 2011-01-16T11:31:22.323 回答
0

感谢您使用 Berkeley DB 和您的问题。Berkeley DB 团队不经常关注此网站上的问题。您最好在此处的 Berkeley DB 论坛上发布您的问题:

http://forums.oracle.com/forums/forum.jspa?forumID=271

如果您在那里发帖,我们会尽量及时回复。

问候, Alex Gorrod Oracle Berkeley DB

于 2011-01-11T21:27:46.377 回答