LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing header files when importing a shared library with labview 8.6?

Hi all,

 

I want to import a .dll into my .vi program but I am not able to do it...

I have created the dll  following the ni website tutorial

 

http://zone.ni.com/devzone/cda/tut/p/id/3303#toc2

 

Once the dll has been created, I have tried to import it with

 

Tools-Import-Shared Library(dll)

 

After parsing the header file appears an error like this one:

 

void __cdecl Zdmt(LVBoolean *stop, double P, char channelName[],
    TD1 *errorIn, TD14 *FFTOptions, TD12 *Calibration, char FileName[],
    int32_t minRecordLength, TD26 *InstrumentHandler, LVRefNum sessionRefArray[],
    LVRefNum *queueIN, TD1 *errorOut, LVBoolean *averagingDone,
    HWAVES LastRecordFetched, TD24 *Impedance, TD17 *ColeColeCluster,
    TD18 *FFTcluster, TD5 *InstrumentHandleOutputCluster, LVRefNum *queueOut,
    int32_t *Acquired, TD6 *FreqTimeInfoCluster, double *averagesCompleted,
    int32_t len);

The following symbols are not defined:
LVBoolean; int32_t; LVRefNum;

Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add predefined symbols. Click the Back button to return to the previous page of the wizard to add a preprocessor definitionsl (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").

The following header file was not found in the specified header file or one of the referenced header files:
-  extcode.h

To fix, click the Back button to go to the previous page and add the header file path to the Include Paths list.

 

I have replaced the first line #include "extcode.h" of the dll header file for #include "C:\Program Files\National Instruments\LabVIEW 8.6\cintools\extcode.h" that is the full path where the header file is located. However, new libraries seems to be missed:

 

-  stdint.h
-  MacTypes.h

 

Does anybody know what I have to do??

 

Any help will be really appreciated,

 

Regards,

 

Benjamin

 

 

 

 

0 Kudos
Message 1 of 4
(4,935 Views)

Hi Ben,

 

you're not the only one!

I tried the same and managed to get a few steps further by patching a few .h files. It says there don't do it! But deleting a few #if MAC lines got me further.

Anyway still have given up in the end.

I would really appreciate some professional help on the Import Wizard. Are we LV-programmer simply to dump to read C or is there a bug in the Wizard and no one else is even trying it?

 

Jannis

0 Kudos
Message 2 of 4
(4,816 Views)

I too have a similar problem.

 

"The following header file was not found in the specified header file or one of the referenced header files:
-  limits.h"

 

That would be correct because I do not use any header file by the name of limits.h, never been part of the project, and was not call by any of the code.  I have no idea why it is saying that I need it.  (by the way, the dll builds with no issues, errors, or warnings)

 

The other odd thing is that I have imported this dll before, when it had fewer methods in it, and they all were recognized and NI successfully created the library and wrapper vi(s).  Even now, I am not getting this error on the methods that had been successfully imported previously... just the new ones are erroring out.  And I would like to reiterate that the new methods do NOT reference any header file by the name of limits.h (or anything therein).

 

Thank you for any help you might be able to provide.

 

0 Kudos
Message 3 of 4
(4,183 Views)

If you use any of the LabVIEW cintools headers, they reference other headers too. The import wizard is written in a way that it simply skips parsing datatypes that can not be resolved due to missing header files.  If your functions you want to import references such datatypes then you get an according error about any include files the wizard could not load, otherwise not. The wizard can not know which of the missing header files is the problem since it obviously doesn't know what would be in those header files.

 

The LabVIEW cintools headers are multiplatform, meaning they evaluate various compiler predefined defines to determine which platform they are included in. The import library wizard does not define any specific defines, since it is not really a compiler. So you have to define them. And they get adapted with each new LabVIEW version to support new compilers and compiler versions, so the defines described in the link in the first post do not have to be correct for cintools headers in newer LabVIEW versions.

 

All in all writing DLLs that interface to LabVIEW cintools headers should not be done by writing them and then importing them using the wizard but instead you should write the VI and create the Call Library Node, then let LabVIEW create a template C file from the context menu of the Call Library Node and copy that into your C sources and fill in the functions from there.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(4,168 Views)