gpt4 book ai didi

c++ - Google RE2 库无法在 ubuntu 中使用 'make testinstall' 进行编译

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:24:00 26 4
gpt4 key购买 nike

大师们!

我正在使用 Ubuntu 13.10 64 位编译最新的 Google RE2 库,但是“make testinstall”编译失败,这是日志:

kevin@ubuntu:~/re2$ make testinstall

cp testinstall.cc obj(cd obj && g++ -I/usr/local/include -L/usr/local/lib testinstall.cc -lre2 -pthread -o testinstall)/tmp/ccSsaSXS.o: 在函数 main' 中:
testinstall.cc:(.text+0xce): undefined reference
re2::FilteredRE2::FirstMatch(re2::StringPiece const&, std::vector > const&) const'/usr/local/lib/libre2.so:对 pthread_rwlock_rdlock 的 undefined reference
/usr/local/lib/libre2.so: undefined reference
pthread_rwlock_wrlock'/usr/local/lib/libre2.so: 未定义对 pthread_rwlock_destroy 的引用'
/usr/local/lib/libre2.so: undefined reference
pthread_rwlock_init'/usr/local/lib/libre2.so:对“pthread_rwlock_unlock”的 undefined reference collect2:错误:ld 返回 1 退出状态make: * [testinstall] 错误 1

我尝试用-lpthread替换-pthread,仍然失败,然后我转储了libre2.so,发现里面有pthread_xxx。 这是 RE2 论坛中的问题跟踪:https://code.google.com/p/re2/issues/detail?id=100

这里有人曾经成功遵守 RE2 吗?谢谢!

最佳答案

参见 this comment :

Adding -pthread to LDFLAGS seems to fix make test (all tests are passing), but not make testinstall.

这会让你进入下一个错误

关于c++ - Google RE2 库无法在 ubuntu 中使用 'make testinstall' 进行编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21948867/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com