LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

imported library function with no argument failed to compile

Hello Experts, I have this library file .lib from a vendor and have functions that I can call to cvi with the following format
extern "C" __declspec(dllimport) BOOL __stdcall SetTargetHalt();
extern "C" __declspec(dllimport) int __stdcall FLASHErase(int ComPort=1, int nDialogBox=0, int nProtocol=0);
So I have put that code on .h file with
#ifdef __cplusplus
extern "C" {
#endif  __declspec(dllimport) BOOL __stdcall SetTargetHalt(); 
__declspec(dllimport) int __stdcall FLASHErase(int ComPort=1, int nDialogBox=0, int nProtocol=0);  
#ifdef
__cplusplus }
#endif
I have placed the .lib and .h file to the project and put the implementation on the source .c  file I have called FLASHErase(arg1,arg2,arg3) with all the arguments supplied and it is working. The problem is when I call the function SetTargetHalt(); the project doesn't compile and the error shows that SetTargetHalt(); doesn't have a prototype, I have tried other functions that don't need an argument but the result is the same asking for prototype. Sorry for a newbie question. Answers appreciated

Message Edited by smoken on 10-09-2007 05:48 AM

________________________________________________________________
Electronics Manufacturing Tester Forum
0 Kudos
Message 1 of 3
(3,179 Views)

Try putting the keyword void in place of the empty parameter lists of the offending function definitions. eg:

    __declspec(dllimport) BOOL __stdcall SetTargetHalt (void);

JR

0 Kudos
Message 2 of 3
(3,175 Views)
thanks that did the job, but I have tried it before with no success, or I am just too exhausted already.
________________________________________________________________
Electronics Manufacturing Tester Forum
0 Kudos
Message 3 of 3
(3,160 Views)