LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import Shared Library Wizard: Declarations not found

Hi,

 

I am trying to import a dll using the wizard but I get the error:

"The shared library contains 102 function(s). But no function is found and recognized in the header file. The following function(s) cannot be wrapped."

Looking at the C example of the manufacturer they declare the following header files: #include <stdio.h>, #include <stdlib.h>, #include <math.h> additionaly to their own.

Do I need to find these files somewhere? or is it a way to define them as a Pre-processor.

 

My knowlegde about dll call is rather limited so thank you in advance for your help.

 

Florian

0 Kudos
Message 1 of 2
(1,409 Views)

These are some of the header files for the so called C runtime library most C(++) compilers come with. The Import Library Wizard isn't a C compiler but "only" a header file parser.

 

One possibility to get at these files is to download and install the Microsoft Windows SDK but that is quite a huge install. Any other C compiler including the National Instruments CVI package comes with its own headers too, so that is another possibility.

 

Most likely (hopefully for you) they don't really use any function declarations from those headers but only some datatype defines, so another possibiliy is to go through the header file and find those datatypes and then define them yourself in the first page of the Import Library Wizard in terms of the build in C types char, short, int, long, single, double, and unsigned. Unfortunately no import library wizard is magical enough to really import anything but the most trivial DLL fully automatically. DLLs were meant to be called from C code and the interface for them assumes that anyone wanting to use them has some good understanding of C programming, datatypes and memory management. Only very little of that can be retrieved from the C syntax in a header file, the rest is either taken from a hopefully existing library documentation and/or a combination of programming experience and trial and error, which in this case usually means an almost endless cycle of compile, crash, edit, compile, and so on.

 

Even if you do not get any errors in the import library wizard and end up with a VI library in the end, assuming that this VI library is not corrupting any memory somehow without going into every VI and verifying it with the function prototype in the header file, any library documentation you have and some pretty well developed C programming knowledge, really is nothing more than a disaster waiting to happen at some point.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 2 of 2
(1,371 Views)