LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between dll and static library, multiple dlls

This is actually a two part question:

In debug mode, I have one dll, DLL A that needs functions from another dll, DLL B.  DLL B will, in the future, be provided by someone else, exporting the functions that are needed now by DLL A.  Both of these DLLs are accessed by the executable.  The dlls will be static libraries in release mode and will also be accessed by the executable.  I do not want DLL A to know anything about DLL B, even though it needs functions from DLL B.

When I build DLL A as a dll, it fails to link because it needs functions from somewhere else.  When I build DLL A as a static library, no linker complaints. Is this even doable in Windows?  If so, what do I need to do?

Secondly, how do I define two configurations for the same executable project, Debug which uses DLL A and DLL B, and Release which will use non-debug static libraries instead of the dlls?

I can't make head or tail out of the documentation and constructing a search string for these two issues is beyond me.

Any help would be appreciated.
0 Kudos
Message 1 of 4
(3,392 Views)
Hi SBSB,

In regards to your first question, dll A has to know at least the functions for dll B so you must have a header file for exported functions from dll B, otherwise it would have no way to call into dll B. Is dll B's import library and its header file included as part of the project? You can also use some Windows SDK functions to dynamically load a dll at runtime which may help you avoid the problem.

With regards to the second issue, this KB should help you in defining the two configurations in your code.


Test Engineer - CTA
0 Kudos
Message 2 of 4
(3,368 Views)
Jon,

Thank you very much for your reply.

I believe I need to go with the Windows SDK method for loading in the DLL; thanks for that.

As for the two configurations, I can use the CVI_DEBUG macro, but how do I define the release configuration to link to a library and the debug configuration to use a DLL?


0 Kudos
Message 3 of 4
(3,359 Views)
This isn't the most elegant solution but it might work. You could also create two different projects, one for debug and one for release though that is even less elegant solution.
Test Engineer - CTA
0 Kudos
Message 4 of 4
(3,350 Views)