12-27-2009 02:35 AM
Now I 'm tring to make a dll through cyapi.lib,so that labview can call the function for conneting usb device(cy68013 produced by cypress company),but i am not sure this way is viable.
this my simple code of translate cyapi.lib to cyapi.dll:
#include "typedef.h"
#include "CyAPI.h"
#pragma comment(lib,"CyAPI.lib")
extern bool _declspec(dllexport) Open_0(void);
CCyUSBDevice *USBDevice=new CCyUSBDevice();
bool Open_0()
{
return USBDevice->Open(0); //get a funtion that can open device 0
}
the link error is this:
Compiling...
CyAPI.cpp
Linking...
Creating library Debug/MainDLL.lib and object Debug/MainDLL.exp
CyAPI.lib(CyAPI.obj) : error LNK2001: unresolved external symbol ___security_cookie
CyAPI.lib(CyAPI.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
CyAPI.lib(CyAPI.obj) : error LNK2001: unresolved external symbol ___CxxFrameHandler3
CyAPI.lib(CyAPI.obj) : error LNK2001: unresolved external symbol __EH_epilog3
CyAPI.lib(CyAPI.obj) : error LNK2001: unresolved external symbol __EH_prolog3
CyAPI.lib(CyAPI.obj) : error LNK2001: unresolved external symbol __EH_epilog3_GS
CyAPI.lib(CyAPI.obj) : error LNK2001: unresolved external symbol __EH_prolog3_GS
my guess maybe the reason is Ihaven't initialize all the variable used in the cyapi.lib or there are something wrong in VC develop enviroment.
Does anyone can help me?
Solved! Go to Solution.
12-27-2009 08:15 AM
Technically, this isn't even a LabVIEW question, so your question would be better asked over at the Cypress forums. A Google search yielded this cached forum post, which does not seem to be available anymore on the "live" forum.
Are you sure you're supposed to be using cyapi.lib? I would expect a vendor like Cypress to provide a ready-made DLL to call from Windows.
12-27-2009 10:48 PM
I'm just not sure this way will success.Maybe it is possible to make it but will cost a lot time to solve the problem.
Cypress provide another way for developor ,cyapi.dll,but which is compiled by C#.My lV is 8.5 version and I'm not fimilar with C#,so I have to find a effective way to shorten the development time.
Think for your replay,and I expect for my suggestion.
12-27-2009 11:49 PM
12-29-2009 04:02 AM