When you build a shared library, you configure LabVIEW to use the C calling convention in the .c source file you built with the Call Library Function Node. In contrast, you use the __stdcall calling convention when you call the Win32 API. When you build a shared library with __stdcall, you normally use a module definition (.def) file to export the functions in your shared library. In the absence of a .def file, __stdcall might truncate function names in an unpredictable pattern, so the actual function name would be unavailable to applications that call the shared library.
You can associate a .def file with a shared library. The .def file contains the statements for defining a shared library, such as the name of the shared library and the functions that it exports, as shown in the following example code:
LIBRARY myshared
EXPORTS
avg_num
The preceding code example demonstrates the following key requirements for .def files:
![]() |
Note Instead of a .def file, many Windows programmers use the LINK option in Project Settings of the Visual C++ compiler to obtain equivalent command-line options for most module definition statements. |