Your code is fine. The library can't be found when the dynamic linker is asked to resolve all the missing symbols when you execute the application. Compilation has nothing to do with it - the linker there was able to find the library because you pointed it to it using the "-L" option. Now you have to point it to the linker during runtime. Either place the library in a directory where the linker looks for it (like /usr/lib) or set the LD_LIBRARY_PATH environment variable to the directory containing the library.
Bookmarks