我收到以下错误:
./pcrecpp: symbol lookup error: ./pcrecpp: undefined symbol: _ZN7pcrecpp2RE6no_argE
在 CentOS 5.4 上运行我的程序时。但它在 CentOS 6.2 上运行良好。pcre的版本是8.31,pcre++的版本是0.9.5。下面是源代码。感谢您的任何指导。
#include <iostream>
#include <pcrecpp.h>
int main(int argc, char ** argv)
{
if (argc != 3)
{
std::cerr << "Usage: " << argv[0] << " pattern text\n";
return 1;
}
pcrecpp::RE oPattern(argv[1]);
if (oPattern.FullMatch(argv[2]))
{
std::cout << argv[2] << " fully matches " << argv[1] << "\n";
}
else if (oPattern.PartialMatch(argv[2]))
{
std::cout << argv[2] << " partially matches " << argv[1] << "\n";
}
else
{
std::cout << argv[2] << " dose not match " << argv[1] << "\n";
}
}