Dynamic link library

bridged with qdn.public.devtools
Post Reply
Lungwen Han

Dynamic link library

Post by Lungwen Han » Tue Nov 05, 2002 2:08 am

Hi,

I tried to link a DLL into my application and failed. The error message "
Could not find library myLib.so". Please kindly let me know what I have done
wrong.

The makefile of the ../dll/nto/x86/o.so has -shared added into CCFLAGS and
the library is created as myLib.so.

The makefile of the ../application/nto/x86/o/ has -Bdynamic -l myLib.so
added into CCFLAGS and the binary is created.
The common.mk of ../application has LDFLAGS = -l /usr/lib/myLib.so added.

Thanks in advance.

lungwen

B.K. Hlady

Re: Dynamic link library

Post by B.K. Hlady » Sun Nov 10, 2002 2:55 pm

Several suggestions:

First, when building your library, create it as libmyLib.so.

Second, when building your application use -l myLib (-ell) to specify the
library, and -L /usr/lib to specify the library search paths. These only
need to be specified in LDFLAGS.

Please note, the default behaviour for the linker is to add lib..<a|so>. So
when it goes to link in the shared library, it will turn myLib into
libmyLib.so. However, when you specify -lmyLib.so it will look for
libmyLib.so.so.

Hope this helps.

Cheers,
-Brian

"Lungwen Han" <lhan@eitc.epson.com> wrote in message
news:aq78t4$lhn$1@inn.qnx.com...
Hi,

I tried to link a DLL into my application and failed. The error message "
Could not find library myLib.so". Please kindly let me know what I have
done
wrong.

The makefile of the ../dll/nto/x86/o.so has -shared added into CCFLAGS and
the library is created as myLib.so.

The makefile of the ../application/nto/x86/o/ has -Bdynamic -l myLib.so
added into CCFLAGS and the binary is created.
The common.mk of ../application has LDFLAGS = -l /usr/lib/myLib.so added.

Thanks in advance.

lungwen




Post Reply

Return to “qdn.public.devtools”