10-11-2012 04:55 PM
Hello,
I want to call a Vi(compiled to a .dll) in C++. Sadly there are very litte Examples.The Vi should just take 2 numbers and return the sum. I added the cintools folder correctly to my project and Visual Studio 2010 gives mit the following Error:
What is my mistake?
Thanks
Matthias
I
10-11-2012 06:50 PM
I haven't looked at your attachment, but does the target computer have the correct version of the LabVIEW run time engine installed?
(details)
What LabVIEW version was used to make the dll?
10-12-2012 03:03 AM
I used Labview 2011 to compile the .dll . I tried to execute it on the same computer I compiled it. Do I have to install Labview 2011 und Labview Runtime Environment?
10-15-2012 02:42 AM - edited 10-15-2012 02:49 AM
When you create a DLL in LabVIEW you get the DLL file, a .h file and a .lib file. The DLL file is obvious where to put, the .h file needs to be #included in your C(++) source code somewhere, and the .lib file needs to be linked with whatever executable file you are producing. Now there is a potential gotcha with this since the created /lib file is in COFF library format, the binary format used by the Microsoft C compiler. If you are using a different C compiler than from Microsoft, it may not like the COFF library format at all, or at least have some trouble to process the specific format created for Microsoft C.
If that is a problem in your case you can work around it by caling LoadLibrary() and GetProcAddress() explicitedly for every function you want to call from the LabVIEW DLL, and avoid the need for the created link library entirely.
But since you seem to be using Microsoft Viaul C, simply make sure to open the project settings and there the linker settings for your target file, and then under additional link libraries, add your addition.lib file.
10-15-2012 07:22 AM
Hi,
The Runtime Engine is normally automatically installed while installing LV.
But to be shure you can check in MAX->Software if it is also installed on the computer on which you compiled your .dll file.
Regards
Daniel
10-16-2012 06:26 AM
Sorry Danial, but the compile errors in Visual Studio have nothing to do with the LabVIEW runtime system. They come from the fact that the link library for the DLL has not been included in the link settings for the VS project. Once the OP gets past this and receives some error messages when trying to start the executable that calls the LabVIEW DLL we can go and look if the runtime system is an issue.
10-16-2012 06:38 AM
Hello Rolf,
I think you are right about the problem with the not included library.
I just wantet to tell Matthias how he can check his installed software and the versions of this software.
I think your advice should help to prevent the error Matthias is getting right now.
Regards
Daniel
10-22-2012 02:11 AM
Hi Matthias,
any new information?
Regards
Daniel
03-04-2013 01:24 AM
hi, i am new in this field and i have no idea how i cant post a new thread.
but i have problem with my labview program which in associate with cRio-9025
which also doing the data acquisition of temperature.
below is my programing, pls help me to check on it.
Apprecite it, thanks
03-04-2013 01:46 AM
In order to post a new topic you first should make a search in the forum for your topic and not simply attach it to some completely unrelated post. On the result page you should find the option to create a new topic.