新手求助,关于函数返回值问题
dll 函数:
EXPORT client* lib_create( uint number, char* pass )//
{
client* q;
if( !if_init )
lib_init();
NEW( q, sizeof(client) );
if( !q ){
DEL( q );
return NULL;
}
client_create( q, number, pass );
q->auto_accept = 1; //temporarily do this
return q;
}
EXPORT int lib_login( client* q )//2222222222
{
int ret;
pthread_t ptr;
ret = pthread_create( &ptr, NULL, login_ex, (void*)q );
if( ret != 0 ){
DBG("thread creation failed. ret=%d", ret );
}
return ret;
}
调用函数 :
HMODULE hInst;
hInst = LoadLibrary("lib.dll");
typedef void (CALLBACK* CallDll)(uint a, char* b);
CallDll fun= (CallDll)GetProcAddress(hInst,"lib_create");
q=fun( uid, password);
typedef void (CALLBACK* CallDl)(client* q);
CallDl fun1= (CallDll)GetProcAddress(hInst,"lib_login");
fun1( q );
FreeLibrary(hInst);
出现错误 :393 F:\MY~1\8811\my.c void value not ignored as it ought to be
396 F:\MY~1\8811\my.c [Warning] initialization from incompatible pointer type
是怎么回事啊?