LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when converting CVI built in DLL sample to VC(6.0) DLL by using Measurement Studio AppWizard

I'm just using CVI built-in DLL sample(\National Instruments\CVI71\samples\dll\basic\cvidll) and trying to convert it to Visual C++(6.0) DLL by using Measurement Studio AppWizard(7.0 for VS 6.0). Errors as follow:. It's very discouraged since i can convert built-in DLL to VC DLL.
--------------------Configuration: g - Win32 Release--------------------
Compiling...
toolbox.c
cvidll.c
Linking...
g.def : error LNK2001: unresolved external symbol SampleExportedFuncName
Release/g.lib : fatal error LNK1120: 1 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
Error executing link.exe.

g.dll - 3 error(s), 0 warning(s)

0 Kudos
Message 1 of 3
(3,271 Views)
When you convert a CVI DLL using this wizard, a .def file is added to the project so that you can add any DLL exports.  This file is needed because CVI handles DLL exports in a way that Visual C++ does not support.  To fix this linker error, you need to comment out this line with a semi-colon in the .def file:
SampleExportedFuncName
This should solve the problem.
 
Jessica
0 Kudos
Message 2 of 3
(3,231 Views)
Jacky,

In addition to commenting out the "SampleExportedFuncName", you must also include a list of the names of the functions exported by the dll.  For that specific example, I believe you can use the following:

    DLLFunc1 @1
    DLLFunc2 @2

This site has some great information on using the def files for creating a DLL with the .def file.


Regards,

Andrew W.  || Applications Engineer
0 Kudos
Message 3 of 3
(3,223 Views)