1

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";
    }
}
SingerOfTheFall
  • 29,228
  • 8
  • 68
  • 105

0 Answers0