shared library : libfg.so: cannot open shared object file error 40
I am using Ubuntu 8.10
I wrote a simple program using shared library. this is what I did.
gcc -c -fPIC s1.c
gcc -c -fPIC s2.c
gcc -shared -fPIC -o libfg.so s1.o s2.o
gcc -c app.c
gcc -o app app.o -L. -lfg
./app: error while loading shared libraries: libfg.so: cannot open shared object file: Error 40
Why am I getting this error? What is error 40?
The program works if i make libfg a static library instead of a shared one.
Are you sure you haven't another libfg.so installed on your system? libfg already is the Video4Linux Frame Grabber interface. Can you try to assign another name to the shared object? E.g.
thanks for replying. i had tried
gcc -o app app.o -L. -Wl,-rpath,. and it had worked.
when it wasn't working earlier i had created symbolic links to my libfg.so in usr/lib usr/local/lib and /lib. Any idea why it wasn't working earlier.
|All times are GMT -5. The time now is 12:36 AM.|