re2 library loading

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

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

error while loading shared libraries: cannot open shared object file: No such file or directory

I have checked and 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 ?


Thanks guys as everybody has pointed out, running sudo ldconfig did the trick. I was not even aware what ldconfig is ? Thanks for great response. I dont know how to mark a comment as accepted answer, so just a thanks has to do. @sehe No it did not gave any link errors, but its a good tip that I'll remember in the future.

Need Your Help

Handling loops in Brainf*ck

c loops brainfuck

I tried testing my Brainfuck interpreter in c with this bottle shaped code in Brainfuck:

issue while looping a json array

javascript jquery sql json

I retrieve some option for a select from an ajax call in json format.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.