gpt4 book ai didi

c - libyahoo 段错误

转载 作者:太空宇宙 更新时间:2023-11-04 11:34:14 26 4
gpt4 key购买 nike

<分区>

我写了这段代码:

#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.

我该如何调试?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com