LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting undefined symbol "__chkesp" link error

I am using USB code from MSVC and I get this link error.
 
 1 Project link error
  Undefined symbol '__chkesp' referenced in "usb.lib".
MS says the fix is to disable stack checking by using the /GZ switch option
But how do I do this in CVI
 
- Make Software User Friendly -
0 Kudos
Message 1 of 2
(3,627 Views)
You have two options:

1 - If you have the source to the library, recompile it in MSVC without stack-checking. MSVC is putting the reference to __chkesp into the library and we cannot remove or ignore it.

2 - Wrap the library in a DLL in MSVC. Create a new empty DLL in MSVC and add "usb.lib" to the project. You have to get MSVC to export all your functions from the DLL, which may be a bit painful. Unfortunately, I don't know a good way to do this, other than manually

    A - creating a .def file

or

    B - including the header file and marking every function __declspec(dllexport).

Anyway, MSVC should resolve the reference to __chkesp against its own libraries, and you should then be able to use the DLL and its import library from CVI.

--- Peter
Message 2 of 2
(3,619 Views)