LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a dll by CVI and call it in VC2005?

I would like to create a dll by CVI8.5 and this dll should by called from VC2005.
 
I managed to create this dll from \CVI85\samples\dll\simple dll example. In this example, both dll and caller are write by CVI8.5.
Now I would like to change the caller from CVI8.5 to VC2005. I copy the .h .lib and .dll files from dll project to VC2005 project.
I add cvirt.lib and cvisupp.lib. But it still occur link error LNK2019. plz see the attachment.
 
 
Download All
0 Kudos
Message 1 of 2
(2,886 Views)

Have you tried using the following syntax in the header file for the dll that is created by CVI:

#ifdef __cplusplus
extern "C" {
#endif


// prototypes of functions exported by CVI, imported by VC++

#ifdef __cplusplus
}
#endif"
< td>

This is because VC++ expects function names to be decorated by default, whereas CVI does not. The above syntax tells VC++ to look for plain function names in the dll.

JR

0 Kudos
Message 2 of 2
(2,864 Views)