我不确定是否对ar -x
命令有误解,这是重复出现此问题的方法:
$ nm librocksdb.a | c++filt | grep -s 'rocksdb::Footer::Footer'
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
0000000000000740 T rocksdb::Footer::Footer(unsigned long, unsigned int)
0000000000000740 T rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
librocksdb.a
中提取成员并尝试查找符号:$ ar -x librocksdb.a
$ nm *.o | c++filt | grep -s 'rocksdb::Footer::Footer'
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
U rocksdb::Footer::Footer(unsigned long, unsigned int)
我们可以注意到,所有符号现在都已 U 未定义。
任何人都可以帮助解释为什么或以错误的方式使用它吗?
(背景:我打算做的是从多个静态库中提取所有对象,然后将它们重新打包到一个静态库中)