大师!
我正在使用 Ubuntu 13.10 64 位编译最新的 Google RE2 库,但“make testinstall”编译失败,这里是日志:
kevin@ubuntu:~/re2$ 进行测试安装
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 to
re2::FilteredRE2 ::FirstMatch(re2::StringPiece const&, std::vector > const&) const' /usr/local/lib/libre2.so: 未定义引用pthread_rwlock_rdlock'
/usr/local/lib/libre2.so: undefined reference to
pthread_rwlock_wrlock' /usr/local/lib/libre2.so: 未定义引用pthread_rwlock_destroy'
/usr/local/lib/libre2.so: undefined reference to
pthread_rwlock_init ' /usr/local/lib/libre2.so: 未定义引用 `pthread_rwlock_unlock' collect2: 错误: ld 返回 1 退出状态 make: * [testinstall] 错误 1
我试图用-lpthread替换-pthread,仍然失败,然后我转储libre2.so,发现pthread_xxx在其中。这是 RE2 论坛中的问题跟踪:https ://code.google.com/p/re2/issues/detail?id=100
这里有人成功地遵守了RE2吗?谢谢!