一个关于动态连接库的问题。(非常感谢)
我用了一个动态连接库,头文件和dll都已经包括了,但还是编译不过去为何?
下面是接口:
// interface.h
#ifndef _INTERFACE_H
#define _INTERFACE_H
typedef int (*SERVER_CONNECT_CALL)(int handle);//???????????????????????????????
typedef int (*SERVER_DISCONNECT_CALL)(int handle);
typedef int (*SERVER_READ_CALL)(int handle);
typedef int (*SERVER_WRITE_CALL)(int handle);
void WINAPI _Server_Set_Callback(LPVOID call1,LPVOID call2,LPVOID call3,LPVOID call4); //????????
void WINAPI _Server_Create(int port);
void WINAPI _Server_Release();
int WINAPI _ServerData_Read(int handle, LPBYTE in );
int WINAPI _ServerData_Write(int handle, LPBYTE in, int nBytes);
int WINAPI _Server_Connect_Amount();
typedef int (*CLIENT_CONNECT_CALL)(int handle);
typedef int (*CLIENT_DISCONNECT_CALL)(int handle);
typedef int (*CLIENT_READ_CALL)(int handle);
typedef int (*CLIENT_WRITE_CALL)(int handle);
void WINAPI _Client_Set_Callback(LPVOID call1,LPVOID call2,LPVOID call3,LPVOID call4);
int WINAPI _Client_Initial();
int WINAPI _Client_Create(char *ip, int port);
void WINAPI _Client_Release();
void WINAPI _Client_Close();
int WINAPI _Client_Read(LPBYTE in );
int WINAPI _Client_Write(LPBYTE in, int nBytes);
int WINAPI _Get_Sockname(int handle, char *ip);
#endif
我这样调用
void CTNetClientDoc::OnListen()
{
// TODO: Add your command handler code here
_Server_Create(3320);
}
编译错误是这样的:
TNetClientDoc.obj : error LNK2001: unresolved external symbol "void __stdcall _Server_Create(int)" (?_Server_Create@@YGXH@Z)
Debug/TNetClient.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
帮忙解释一下,非常感谢,在线等待。