A test program of mine loads a shared library (.so file). A function
call in the shared library throws an exception that I am trying to
catch in the main function of my test program. (I know that exception is being thrown for sure, I wrote the library to do that.)
However in the main program, the exception is not being caught. The flow of program goes past the catch block like no error has occurred. I am using g++ and I load the shared file using -l option. Only trying to load the program
statically I got the following error:
/usr/bin/ld: cannot find -lmy-shared-library
collect2: ld returned 1 exit status
Any idea why the exception is not getting caught. Searched around the
net but couldn't get much help. I posted this question on google group too but couldn't get any answers there.
Yes, I am compiling the library with the same compiler. In fact, I wrote that library and my test program on the same machine and compiled them on the same machine. Compiled the library first into a .so file, installed it on my machine, and then begin compiling my main program.