05-14-2007 01:37 AM
05-14-2007 10:00 AM
05-14-2007 10:08 AM
Hi RonnyG,
The problem is that you are not exporting those functions (sum and summe) from
your DLL. You need to do this so external programs like CVI can access those
functions. This is why you are getting the undefined symbol errors since CVI
can't find the exported functions. You need to be using the dllexport keyword to declare a function to be
exported. For example, you would say:
__declspec(dllexport) int __cdecl sum(int a, int b);
Refer to the Microsoft Exporting
from a DLL Using __declspec(dllexport) document and the FAQ: Using Dynamic Link
Libraries with LabWindows/CVI tutorial for help.
You also need to make address the issue of mangled functions names in C++.
Essentially, if you are creating a DLL using Visual C++ for use with
LabWindows/CVI, you must mark the exported functions with extern
"C" to specify that these functions will be used with a C
compiler. If you do not mark an exported function with extern "C",
LabWindows/CVI will not be able to call that function because C++ compilers
mangle function names when they are exported from a DLL. So, for example you
would say something like:
extern "C" char __declspec(dllexport) GetChar( void )
This topic is also discussed in that CVI tutorial.
Hope this helps!
Best Regards,