LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI DLL in VC 6.0

I found a xample in this website named "Creating a CVI DLL that contains a UIR file and Using the DLL in VC ++, but I have the next error when I tried to compile:

testDLLDlg.obj : error LNK2001: unresolved external symbol "void __cdecl OpenPanel(void)" (?OpenPanel@@YAXXZ)

Can you help me ??

Thanx..
0 Kudos
Message 1 of 3
(3,119 Views)
It looks like you are having a problem with name mangling on VC++. Whenever I create a DLL in CVI that might be called from C++, in the export .h file for the CVI DLL I call the entire file extern "C" to avoid name mangling.
At the start of the .h file for the CVI DLL, include the following lines.
// call everything extern C if a C++ compiler is used
#ifdef __cplusplus
extern "C" {
#endif
At the end of the .h file, include these lines.
// end of extern C block if a C++ compiler is used
#ifdef __cplusplus
}
#endif

0 Kudos
Message 2 of 3
(3,119 Views)
Hi,

From the info on the error this definately looks like a name mangling error. Also make sure that you are including the .lib file in your project.

You can use Dependency Walker to check whether a dll exports C or C++ functions.

Just my 2 cents.

Juan Carlos
N.I.
0 Kudos
Message 3 of 3
(3,119 Views)