Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

re2 library loading

Tags:

c++

regex

re2

I am using the following code to test google's RE2 library

int main()
{
  int r = RE2::FullMatch("hello", "h.*o");
  cout <<" match = " << r << endl;
  return 0;
}

I am compling using the following command -

g++ -lre2 -o retest retest.cc

It is compiling fine, but when I am trying to run retest with ./retest its throwing the following error -

error while loading shared libraries: libre2.so.0: cannot open shared object file: No such file or directory

I have checked and libre2.so.0 library does exist at user/local/lib directory and re2/obj/so directory. So why is this error coming am I forgetting some detail to add ?

like image 222
ocwirk Avatar asked Nov 30 '11 09:11

ocwirk


1 Answers

Running sudo ldconfig did the trick.

like image 114
ocwirk Avatar answered Sep 23 '22 09:09

ocwirk