LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What is relationship between *.h *.dll and *.lib

Hi,
 
Althought I manage to make things run, I'm still confused about the relationship between the header, dll and lib fils....
 
I have one project (GUI) which I made as a dll.  THis dll can be called from TS and from another dll.
I have another project (GPIB) which can also be read from TS and also use functioins from the GUI.
 
I created the GUI dll with symbol Marked for export'.  I don't know why but it was the only one that worked....
Then I ctreated the GPIB dll with same setting.  the GUI.h was included so the functions I called were recognized.  but I got a link error.
The link error disappeared when I included the lib file to the GPIB project.
 
Can sombody explain the relationship between dll file and lib file....why do I have to include the lib file?
 
Thanks
0 Kudos
Message 1 of 2
(4,490 Views)

Hi Rafi2003,

Take a look at my post here that explains the basic differences. It also has some good links as well.

The overview of what I talk about in that post is that when you include the header file (
.h) and import library (.lib) of a DLL in your LabWindows/CVI project, you are statically linking to that DLL.  The alternative way to call DLLs is through dynamic linking which means you load the DLL at run-time via the LoadLibrary and GetProcAddress Windows SDK methods. This method just requires the DLL and no other files.

To address your exporting confusion, whenever you create a DLL, you need to specify what functions you export and make available to the user of the DLL. When you select the Symbols marked for export, the DLL exports all symbols you define in the DLL with the __declspec(dllexport) or export qualifier. For more information on that, see the Target Settings for DLLs help topic in the LabWindows/CVI Help.

Best Regards,

Jonathan N.
National Instruments
Message 2 of 2
(4,484 Views)