Re: [問題] http_fetcher編譯問題
自問自答,
問題解決了,
編譯的方式為:gcc -I../include -L../lib -lhttp_fetcher t.c
執行的方式為:LD_LIBRARY_PATH=../lib ./a.out
感恩~
※ 引述《sacanner (Sam)》之銘言:
: 哦,感謝,測試出來發現原來他的lib是c語言寫出來的,
: 因此我用g++來編譯時就發生上述的問題,
: 不過我的測試檔換成.c檔後,
: 他出現另一個問題:
: ./a.out
: /libexec/ld-elf.so.1: Shared object "libhttp_fetcher.so.2" not found, required
: by "a.out"
: 我是不是能在編譯時加上什麼參數,來指定libhttp_fetcher.so.2的位置呢?
: 謝謝告知~
: ※ 引述《weiyucsie (選擇那刻 才算開始)》之銘言:
: : 稍微下載測試後
: : 發現http_fetch的prototype為
: : int http_fetch(const char *url, char **fileBuf);
: : 對照其comment
: : Download the page, registering a hit. If you pass it a NULL for fileBuf,
: : 'url' will be requested but will not remain in memory (useful for
: : simply registering a hit). Otherwise necessary space will be allocated
: : and will be pointed to by fileBuf. Note that a NULL byte is
: : added to the data, so the actual buffer will be the file size + 1.
: : 看起來是你的用法錯了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.101.165
討論串 (同標題文章)
FreeBSD 近期熱門文章
PTT數位生活區 即時熱門文章