LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

create dll from .c, .lib, and .h

Hi 

 

I have to use an acquisition card : the 'ACPI 3120' ADDI DATA 

 

Addi Data provides samples with this card, but they are contained in 3 files : one C source file, one C header file, and a .lib file

 

I have to create a dll to use the acquisition functions with thi card

 

But when I  want to compile the dll, CVI says :

 

ERROR: Exporting a variable or function defined in an import  Iibrary s not supported.  Unable b export ‘j_APC13120_Initcompiler@4’.  Aborting DLL Creation, 

 In fact, this function 'ACPI3120_InitCompiler' is in the lib file 

 

Is there a way to create a dll using a lib file ? 

 

Thank you for your answers 

 

 

 

 

0 Kudos
Message 1 of 5
(4,564 Views)

If the Addi Data lib file is an import library file, then there must already be an associated dll file as well. Presumably your code will extend the functionality of their existing library, so one quick way to resolve your difficulties is to add wrapper functions of your own, which simply call the supplied library ones. Then just export the wrappers along with your other custom code in the usual way.

 

JR

0 Kudos
Message 2 of 5
(4,558 Views)

Thank You for your answer Jr_2005. I found this dll shipped with the card

 

I'm now trying to load this dll in the dll I'm trying to create.

 

Is it possible to load a dll inside a dll ? 

 

 

0 Kudos
Message 3 of 5
(4,550 Views)

Yes you can load a dll from a dll.

 

Either explicitly (dynamically) with LoadLibraryEx function or implicitly (statically, at program start) simply by binding the export library of the second dll to the first dll.

0 Kudos
Message 4 of 5
(4,544 Views)

Thank you for your answers ... it works 

 

🙂 

0 Kudos
Message 5 of 5
(4,536 Views)