Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Linking a DLL with a shared library possible?: (3 Items)
   
Linking a DLL with a shared library possible?  
We have 3 QNX C/C++ projects.  An application, a dynamic shared library and a DLL.  The application will use the DLL and
 the SO, while the DLL will also need to use functions from the SO.  However, I can't get the DLL to link against the SO
 project.  It appears to be trying to find the SO under:

TestSO/x86/dll

rather than

TestSO/x86/so

based on the EXTRA_LIBVPATH line in common.mk for the DLL project.

EXTRA_LIBVPATH+=$(PROJECT_ROOT)/../TestSO/$(CPU)/$(patsubst so%,so%,$(notdir $(CURDIR)))

How do I get the DLL to link against the SO?

Thanks,

Gordon Molek
Zebra Technologies Corp.
Re: Linking a DLL with a shared library possible?  
Ok, by changing the LIBVPATH line to:

EXTRA_LIBVPATH+=$(PROJECT_ROOT)/../TestSO/$(CPU)/$(subst dll,so,$(subst Unittest,g,$(notdir $(CURDIR))))

The DLL completes linking, but under the Binaries"folder" in the C/C++ Projects view (and in the x86/dll directory) I 
see a ".so" rather than a ".dll".

Is it a simple matter of renaming the file to ".dll"?

Re: Linking a DLL with a shared library possible?  
You don't need to link to a DLL at compile time. Dynamic link libraries
have a .so extension under QNX and generally any UNIX based operating
system. Generally, shared libs are found in /lib and /usr/lib while
DLL's a found in /lib/dll. The intention of a DLL is to link dynamically
at run-time using the dlopen/dlsym/dlclose functions.

For more information on dlsym and example source, you can take a look at
the following link:

http://www.qnx.com/developers/docs/6.3.2/neutrino/lib_ref/d/dlsym.html



On Fri, 2008-09-26 at 09:29 -0400, Gordon Molek wrote:
> Ok, by changing the LIBVPATH line to:
> 
> EXTRA_LIBVPATH+=$(PROJECT_ROOT)/../TestSO/$(CPU)/$(subst dll,so,$(subst Unittest,g,$(notdir $(CURDIR))))
> 
> The DLL completes linking, but under the Binaries"folder" in the C/C++ Projects view (and in the x86/dll directory) I 
see a ".so" rather than a ".dll".
> 
> Is it a simple matter of renaming the file to ".dll"?
> 
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post14086
>