0
我寫了這個代碼:libyahoo分段故障
#include <libyahoo2/yahoo2.h>
#include <libyahoo2/yahoo2_callbacks.h>
int main() {
int id ;
char username[255] = "slam";
char password[255] = "ss" ;
id = yahoo_init(username, password);
enum yahoo_status mYahoo ;
mYahoo = YAHOO_STATUS_AVAILABLE ;
yahoo_login(id , mYahoo);
return 0;
}
編譯它,gcc -l yahoo2 y.c -o yahoo
與./yahoo
運行它給了我一個錯誤:Segmentation fault
(gdb) run
Program received signal SIGSEGV, Segmentation fault.
0x001379b1 in yahoo_login (id=1, initial=0) at libyahoo2.c:1735
線1735的代碼是:
tag = YAHOO_CALLBACK(ext_yahoo_connect_async) (yd->client_id,
host, yss->pager_port, yahoo_connected, ccd, 0);
看到這個:
(gdb) list YAHOO_CALLBACK
Function "YAHOO_CALLBACK" not defined.
我該如何調試?