04-27-2006
11:55 AM
- last edited on
08-06-2026
10:20 AM
by
Content Cleaner
Hi there! According to Knowledgebase 1ZQELEY5: How Do I Create an Import Library for a DLL in LabWindows/CVI? I tried to do so for Micro-Epsilons LibOpto.dll which I would like to use with the PCI IF 2004 card and two optoNCDT 2200 Laser Optical Displacement Sensors. The LibOpto.dll and LibOpto.h files are provided from Micro-Epsilon's download page including the descriptions of the function prototypes in the manual.
Now my problem is that I get an error stating: Unable to create import library. Error in header file...
I guess this means that the provided header file doesn't match the dll file.
So what can I do besides figuring out manually what functions are exported from the dll (KnowledgeBase 1ZQDQPY5: How Do I Link to Functions Defined in a Dynamically Linked Library (DLL) fro...)?
Any hints would be appreciated...
Regards whoknows
04-28-2006
02:12 AM
- last edited on
08-06-2026
10:21 AM
by
Content Cleaner
The second link in my first post was not correct... I meant
How to Use an External DLL in LabWindows/CVI When Not Given a Header File [link removed; article no longer available]
Since I'm given all the function prototypes I should be able to do that manually so I'll try this now and hope I'll get it working...
04-28-2006 09:11 AM
04-28-2006 09:55 AM
04-28-2006 10:09 AM - edited 04-28-2006 10:09 AM
If you have the full version of CVI and have installed the windows sdk add the line
#include "windows.h" in libOpto.h. This adds some of the windows definitions needed to use this header. With a little luck this should allow you to generate the type library.
If you don't have the full version of cvi you can download the Windows Platform SDK directly from Microsoft.
Message Edited by mvr on 04-28-2006 10:13 AM
04-28-2006 10:52 AM
04-28-2006 11:03 AM
Windows specific type definitions like WORD and UINT. Including windows.h takes care of this. One thing to note, if you ever need to add windows.h to any of your source files in CVI, make sure that you add it before any of the CVI header files. The windows definitions must be included first.
Good Luck!
04-28-2006 11:14 AM
If you use the version of libOpto.h that includes windows.h, it should be one of the first headers loaded by your c source file. If you want to use the original unmodified libOpto.h, just include windows.h in your c source file first, and you can then include the original libOpto.h in your source file where you would normally place it.
04-28-2006
01:08 PM
- last edited on
08-06-2026
10:21 AM
by
Content Cleaner
05-01-2006
01:19 AM
- last edited on
08-06-2026
10:22 AM
by
Content Cleaner
@ mvr:
Thank your for the information!
So this means I could modify the data types in the LibOpto.h to match standard C types and would therefore not have to include windows.h?
For now I'll just use the include and try if I can get that thing to work...
@ Sheetal:
Take a look at
Display Exported Functions in DLL [link removed; example no longer available]
tried the VI, but shows you just the function names without parameters...
Regards