pcre error “undefined symbol: _ZN7pcrecpp2RE6no_argE”

纵然是瞬间 提交于 2019-12-11 09:36:22

问题


I'm getting the following error:

./pcrecpp: symbol lookup error: ./pcrecpp: undefined symbol: _ZN7pcrecpp2RE6no_argE

when run my program on CentOS 5.4. But it works well on CentOS 6.2. The version of pcre is 8.31, and the version of pcre++ is 0.9.5. Below is the source code. Thanks for any guidance.

#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";
    }
}

来源:https://stackoverflow.com/questions/12294404/pcre-error-undefined-symbol-zn7pcrecpp2re6no-arge

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!