05-28-2021 09:36 AM
Hi!
I have been following this tutorial:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1OvCAI&l=en-PK
which is an example of how to build a dll file using visual studio and call that dll in labview. An Example project is also provided in this link.
I downloaded the example project, created a new MSVS2019 DLL project, replaced the filers and compiled it successfully (window 10). DLL is generated successfully. I further followed the tutorial on how to call this DLL in labview i.e. via Call Function Library.
But labview gives the following error:
But if I use the DLL provided by the NI, in the example project, it works fine.....
Note: I am using MSVS2019 and This tutorial is using MSVS2010. Can this be the issue?
Also I am using Labview 2019 32-bit.
Thanks in Advance
05-28-2021 09:40 AM
What are the settings for your project?
Are you creating a debug build of your DLL?
Do you try try to load your DLL on the same computer that you used to build your DLL?
05-30-2021 11:06 PM
What are the settings for your project?
I am using MSVS 2019, with solution configuration set to 'Debug' and solution platform set to 'x86'.
Are you creating a debug build of your DLL?
Yes I am using Debug Build for my DLL....
Do you try try to load your DLL on the same computer that you used to build your DLL?
Yes I am using a different computer for building DLL. The DLL file is for use on another computer.
05-30-2021 11:39 PM
One more observation, the DLL that is provided by the NI is 253kb in size, whereas the DLL that I create using MSVS flow takes only 38kb memory. Can this be the reason that something is missing in my DLL? And also the error suggests the same thing, library not found....
05-31-2021 02:26 AM - edited 05-31-2021 02:29 AM
The size is likely because you compile with DLL Debug Runtime while NI had Static Release Runtime.
Static means that the C Runtime library is included in the DLL. The DLL selection means fhat you have to install the according MS C Runtime library on the target computer too. But there exists no Redistributable Debug C Runtime Library from Microsoft. The only way to get that on a computer is by installing Visual C legally.
A Debug build without a working debugger and access to the sources is pretty useless anyhow!
So if you want to use your DLL on a different computer than where you compile it you should select a release build and decide if you want it larger but not requiring the Redistributable C Runtime install, or smaller but requiring the installation of the C Runtime on every target computer!