无法使用 libyahoo2 编译应用程序

标签 c compilation yahoo-api

各位,我遇到了一个让我非常痛苦的问题

我有几行,在编译这些代码时它显示了一些错误

编译时

$ gcc `pkg-config --cflags glib-2.0` main.c -lssl

输出

/tmp/ccQ7vAnA.o: In function `yahoo_ping_timeout_callback':
main.c:(.text+0x4ca): undefined reference to `yahoo_keepalive'
/tmp/ccQ7vAnA.o: In function `yahoo_webcam_timeout_callback':
main.c:(.text+0x6bd): undefined reference to `yahoo_webcam_send_image'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_got_conf_invite':
main.c:(.text+0x86f): undefined reference to `y_list_append'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_conf_userdecline':
main.c:(.text+0x96d): undefined reference to `y_list_remove_link'
main.c:(.text+0x97e): undefined reference to `y_list_free_1'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_conf_userjoin':
main.c:(.text+0xa54): undefined reference to `y_list_append'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_conf_userleave':
main.c:(.text+0xb17): undefined reference to `y_list_remove_link'
main.c:(.text+0xb28): undefined reference to `y_list_free_1'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_conf_message':
main.c:(.text+0xb85): undefined reference to `y_utf8_to_str'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_chat_room_received':
main.c:(.text+0x135d): undefined reference to `yahoo_get_chat_room_list'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_chat_message':
main.c:(.text+0x15c7): undefined reference to `y_utf8_to_str'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_got_buddies':
main.c:(.text+0x1acc): undefined reference to `y_list_append'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_got_im':
main.c:(.text+0x1caa): undefined reference to `y_utf8_to_str'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_webcam_viewer':
main.c:(.text+0x22cc): undefined reference to `yahoo_webcam_accept_viewer'
/tmp/ccQ7vAnA.o: In function `yahoo_logout':
main.c:(.text+0x2528): undefined reference to `yahoo_conference_logoff'
main.c:(.text+0x265e): undefined reference to `yahoo_logoff'
main.c:(.text+0x2671): undefined reference to `yahoo_close'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_login':
main.c:(.text+0x273c): undefined reference to `yahoo_init_with_attributes'
main.c:(.text+0x276a): undefined reference to `yahoo_login'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_login_response':
main.c:(.text+0x27ba): undefined reference to `yahoo_current_status'
/tmp/ccQ7vAnA.o: In function `yahoo_set_current_state':
main.c:(.text+0x2b5a): undefined reference to `yahoo_set_away'
main.c:(.text+0x2b86): undefined reference to `yahoo_set_away'
main.c:(.text+0x2bb2): undefined reference to `yahoo_set_away'
/tmp/ccQ7vAnA.o: In function `ext_yahoo_add_handler':
main.c:(.text+0x2ccb): undefined reference to `y_list_prepend'
/tmp/ccQ7vAnA.o: In function `yahoo_callback':
main.c:(.text+0x3082): undefined reference to `yahoo_read_ready'
main.c:(.text+0x30c5): undefined reference to `yahoo_write_ready'
/tmp/ccQ7vAnA.o: In function `process_commands':
main.c:(.text+0x37b1): undefined reference to `yahoo_send_im'
main.c:(.text+0x37c1): undefined reference to `y_str_to_utf8'
main.c:(.text+0x37fd): undefined reference to `yahoo_send_im'
main.c:(.text+0x390d): undefined reference to `yahoo_conference_message'
main.c:(.text+0x3ad4): undefined reference to `y_list_append'
main.c:(.text+0x3b1e): undefined reference to `y_list_append'
main.c:(.text+0x3b87): undefined reference to `y_list_append'
main.c:(.text+0x3bc3): undefined reference to `yahoo_conference_invite'
main.c:(.text+0x3be4): undefined reference to `y_list_append'
main.c:(.text+0x3c42): undefined reference to `y_list_append'
main.c:(.text+0x3cb7): undefined reference to `y_list_free'
main.c:(.text+0x3d08): undefined reference to `yahoo_conference_addinvite'
main.c:(.text+0x3d27): undefined reference to `y_list_append'
main.c:(.text+0x3d46): undefined reference to `y_list_free'
main.c:(.text+0x3e2c): undefined reference to `y_list_append'
main.c:(.text+0x3e5e): undefined reference to `yahoo_conference_logon'
main.c:(.text+0x3f02): undefined reference to `yahoo_conference_logoff'
main.c:(.text+0x3f16): undefined reference to `y_list_remove'
main.c:(.text+0x40d6): undefined reference to `yahoo_conference_decline'
main.c:(.text+0x40ea): undefined reference to `y_list_remove'
main.c:(.text+0x420b): undefined reference to `yahoo_get_chatrooms'
main.c:(.text+0x4265): undefined reference to `yahoo_get_chat_room_list'
main.c:(.text+0x4383): undefined reference to `yahoo_chat_logon'
main.c:(.text+0x4441): undefined reference to `yahoo_chat_message'
main.c:(.text+0x449b): undefined reference to `yahoo_chat_ignore'
main.c:(.text+0x44f5): undefined reference to `yahoo_chat_ignore'
main.c:(.text+0x4534): undefined reference to `yahoo_chat_logoff'
main.c:(.text+0x4600): undefined reference to `yahoo_set_away'
main.c:(.text+0x4671): undefined reference to `yahoo_get_identities'
main.c:(.text+0x470b): undefined reference to `yahoo_set_identity_status'
main.c:(.text+0x4751): undefined reference to `yahoo_set_identity_status'
main.c:(.text+0x4973): undefined reference to `yahoo_set_yab'
main.c:(.text+0x49fa): undefined reference to `yahoo_webcam_get_feed'
main.c:(.text+0x4a30): undefined reference to `yahoo_webcam_get_feed'
main.c:(.text+0x4a7f): undefined reference to `yahoo_webcam_invite'
/tmp/ccQ7vAnA.o: In function `main':
main.c:(.text+0x4dc0): undefined reference to `yahoo_set_log_level'
main.c:(.text+0x4f44): undefined reference to `y_list_remove_link'
main.c:(.text+0x4f58): undefined reference to `y_list_free_1'
main.c:(.text+0x534e): undefined reference to `y_list_remove_link'
main.c:(.text+0x5362): undefined reference to `y_list_free_1'
/tmp/ccQ7vAnA.o: In function `register_callbacks':
main.c:(.text+0x589a): undefined reference to `yahoo_register_callbacks'
collect2: ld returned 1 exit status

无论如何,我包含了文件夹中的库标题,而不是共享库中的库标题,

#include "yao/yahoo2.h"
#include "yao/yahoo2_callbacks.h"
#include "yao/yahoo_util.h"

我相信,我编译代码的方式是极其错误的,我对此一无所知。 好吧,有人愿意让我摆脱这些痛苦吗?

非常感谢

来源

http://pastebin.com/TBetQxpF

关于stackoverflow上发布字符的限制,我已将其粘贴到pastebin上 我希望这些能让你更容易理解我在说什么......

最佳答案

尝试在 gcc 行中添加 -lyahoo2

编辑: 看来你应该自己实现 ext_* 函数。

来自libyahoo2 - README :

“yahoo2_callbacks.h 包含您必须的函数原型(prototype) 实现。 所有这些功能都必须由您的代码实现。”

编辑2: 尝试在 main() 函数的开头添加对 register_callbacks() 函数的调用。

关于无法使用 libyahoo2 编译应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6268269/

相关文章:

c - 确定终止进程的pid

scala - maven项目编译问题

jakarta-mail - 无法使用 Java 以编程方式搜索 Yahoo Mail?

c - 如何通过 DirectFB 使用鼠标

c - 对字符数组执行 'xor' sumcheck

c++ - #define/macro返回指向同一文件中给出的函数的函数指针

c++ - 没有在C++枚举上命名的类型

swift - 'animate(withDuration:delay:options:animations:)' 的使用不明确

html - 找不到 Yahoo Media Player 又名 Yahoo Web Player 脚本

javascript - 如何从 html 文档中调用 yahoo 天气 api javascript 函数