‎09-04-2011 11:53 PM
I compile this code to dll file with VC++2010 filename is test_dll.dll .
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
using namespace std;
int main(int a){
cout << "Test dll...............\n";
return a;
}
After that, I put Call Library Function node in editor and double click Call Library Function node. I browse test_dll.dll into Library name or path and set function prototype to int32_t main(int32_t a); but it show error Call Library Function Node 'test_dll.dll:main':function not found in libraly. How to use dll in Labview ? And I have more question is what is differrent from Tools -> Import -> Shared Library(.dll) and use Call Library Function node.
Solved! Go to Solution.
‎09-06-2011 01:51 PM
Hi mmc01,
First, you may want to start with this tutorial, which shows how to call a simple C/C++ DLL from LabVIEW. If after going through this document, you still receive the same error, you can check out this resource, which provides solutions for this error. Hope this helps!
‎09-06-2011 09:01 PM
Now I can use dll with labview. but I can't create dll with VC++2010. I try to study with this tutorial http://www.youtube.com/watch?v=I0uGEJKcyik but Labview not found any function in my dll. How to create dll for Labview
‎09-07-2011 08:41 AM
The issue you are having is that LabVIEW is not capable of using C++ DLLs directly. It only handles C DLLs. This does not mean that if you you cannot use the DLL if it's compiled with the C++ compiler as opposed to the C compiler. Rather, it means that you must take extra steps in order to use it from LabVIEW. The primary issue is that of name mangling or adornment. This is discussed here: http://zone.ni.com/devzone/cda/tut/p/id/4877. Basically you need to prepend extern "C" in front of your prototypes in your header files. I would also suggest reviewing this article: https://decibel.ni.com/content/docs/DOC-14564.