小弟菜鳥一名,第一次使用DLL文件.
已經聲名了:
extern "C" _declspec(dllimport) int W_730_Initial(int card_number,int base_address);
extern "C" _declspec(dllimport) int W_730_Set_Card(int card_number);
extern "C" _declspec(dllimport) int W_730_Get_Card(int card_number);
extern "C" _declspec(dllimport) int W_730_DI_Channel(int channel_no,unsigned int *di_data);
extern "C" _declspec(dllimport) int W_730_DI_16(int port,unsigned int *di_data);
extern "C" _declspec(dllimport) int W_730_DI_8(int byte_no,unsigned char *di_data);
extern "C" _declspec(dllimport) int W_730_DO_Channel(int channel_no,unsigned char do_data);
extern "C" _declspec(dllimport) int W_730_DO_16(int port,unsigned int do_data);
extern "C" _declspec(dllimport) int W_730_DO_8(int byte_no,unsigned char *do_data);
extern "C" _declspec(dllimport) int W_730_Read_Back(int byte_no,unsigned char *do_data);
也添加了LIB文件.
使用W_730_DI_16:
String inputdata;
inputdata = W_730_DI_16(1,0);
提示連接錯誤:
[Linker Error] Unresolved external '_W_730_DI_16' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\TESTIO\UNIT1.OBJ
--------------------next---------------------
阅读(1081) | 评论(0) | 转发(0) |