From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL mandatory with a exe application

Solved!
Go to solution

Hello,
I have a question about libraries under CVI.
I created a CVI DLL with an exported function.

I want to reuse this function in a project (.exe), so I import the .lib and .h into my project. Everything works and compiles properly. So I have an .exe.
The problem is that when I execute this exe, it is necessary that the DLL is in the same directory as my exe (or that the path of the dll itself known in the Windows PATH). I thought (maybe wrong), that when we had the .lib in the project, the DLL was not mandatory because all (binary) code was in the .lib. So the compilation of .exe, integrate the "code" of the .lib

Thanks you for your help

Vincent

0 Kudos
Message 1 of 3
(2,533 Views)
Solution
Accepted by topic author AfgVD

Hello Vincent,

 

If you want the binary code to be in the .lib you have to create a Static Library project(Build->Target Type). The .lib that is generated for a dll project is just an import library that specifies where the functions are located in the dll, so it must be accompanied by the dll.

 

Constantin

0 Kudos
Message 2 of 3
(2,509 Views)

Hello,

 

I came to this conclusion. I indeed confused the .lib of import generated during the compilation of a DLL, with that generated during the compilation of a static library

 

Thank you

 

Vincent

0 Kudos
Message 3 of 3
(2,487 Views)