pcre错误“未定义符号:_ZN7pcrecpp2RE6no_argE”

时间:2012-09-06 06:47:50

标签: c++ pcre centos5

我收到以下错误:

./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";
    }
}

0 个答案:

没有答案