在google Native Client (Pepper_19)上将-lboost_thread链接到我的可执行文件时收到此错误:
nacl_sdk/pepper_19/toolchain/mac_x86_glibc/x86_64-nacl/usr/lib/libboost_thread.a:无法读取符号:存档没有索引;请运行ranlib添加一个
我是根据naclports上的说明编译boost的:http://code.google.com/p/naclports/wiki/InstallingSDL (除了使用boost库目录而不是SDL...我也使用了同样的过程来正确编译NaCl zlib库)
cd naclports/src/libraries/boost_1_47_0
export NACL_PACKAGES_BITSIZE=32; ./nacl-boost_1_47_0.sh
export NACL_PACKAGES_BITSIZE=64; ./nacl-boost_1_47_0.sh这将生成libboost_thread.a文件并将其放入我的NACL安装的/usr/lib目录中。我想可能不知何故,我错误地构建了一个错误类型的库来链接NaCl。有没有办法检查和/或修复它?
我试过了:
cd naclports/src/out/repository-x86_64/boost_1_47_0/bin.v2/libs/thread/build/darwin-4.2.1/release/link-static/threading-multi
nm libboost_thread.a这就产生了:
libboost_thread.a(thread.o):
0000000000052d08 s EH_frame0
000000000004f50c s GCC_except_table100
000000000004f534 s GCC_except_table101
000000000004f574 s GCC_except_table102
000000000004f5c0 s GCC_except_table103
000000000004f600 s GCC_except_table104
000000000004f64c s GCC_except_table105
000000000004f68c s GCC_except_table106
000000000004f6d8 s GCC_except_table107
.
.
.
.等等。然而,然后我运行:
nacl_sdk/pepper_19/toolchain/mac_x86_glibc/bin/x86_64-nacl-nm libboost_thread.a
并得到了:
__.SYMDEF SORTED: File format not recognized
nacl_sdk/pepper_19/toolchain/mac_x86_glibc/bin/x86_64-nacl-nm: thread.o: File format not recognized
nacl_sdk/pepper_19/toolchain/mac_x86_glibc/bin/x86_64-nacl-nm: once.o: File format not recognized最后。我跑了一下:
file pthread/thread.o
pthread/thread.o: Mach-O 64-bit object x86_64但是,在zlib对象文件上执行相同的命令会导致:
ELF 64-bit LSB relocatable, x86-64, version 1, not stripped我希望得到关于构建正确交叉编译的NaCl libboost_thread.a的建议。
谢谢。
发布于 2012-07-04 16:50:41
NaCl端口中的一些库只能在linux上构建。因此,您必须找出为什么boost决定使用系统ar而不是x86_64-nacl-ar,或者在它们相同的情况下在linux上安装VM。
https://stackoverflow.com/questions/11006985
复制相似问题