Object Files, Library Files, and DLL Import Libraries
- Updated2023-02-21
- 2 minute(s) read
If you create an object file, library file, or DLL import library in LabWindows/CVI, you can use the file only in compilers that generate files of the Common Object File Format (COFF).
![]() |
Note Static libraries you create in LabWindows/CVI with a debug configuration are not supported outside of LabWindows/CVI. |
If you load an object file, library file, or DLL import library file in LabWindows/CVI, make sure the file is of the Common Object File Format (COFF). If you have a DLL but you do not have a COFF DLL import library, LabWindows/CVI reports an error when you attempt to link your project.
To create a import library, you must have an include file that contains the declarations of all the functions and global variables you want to access from the DLL. Load the include file into a Source window and select Options»Generate DLL Import Library.
Make sure the calling conventions of the function declarations in the include file match the calling conventions of the functions in the DLL. Whereas DLLs usually export functions with the __stdcall calling convention, the __stdcall keyword is sometimes missing from the function declarations in the associated include files. If you generate an import library from an include file that does not agree with the calling convention the DLL uses, you can successfully build a project that contains the import library, but LabWindows/CVI usually reports a general protection fault when you run the project.