http_fetcher編譯問題 - BBS
By Rachel
at 2009-06-27T10:01
at 2009-06-27T10:01
Table of Contents
自問自答,
問題解決了,
編譯的方式為: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.
: : 看起來是你的用法錯了
--
問題解決了,
編譯的方式為: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.
: : 看起來是你的用法錯了
--
Tags:
BBS
All Comments
Related Posts
http_fetcher編譯問題
By Dorothy
at 2009-06-26T22:03
at 2009-06-26T22:03
http_fetcher編譯問題
By Belly
at 2009-06-26T19:33
at 2009-06-26T19:33
http_fetcher編譯問題
By Rae
at 2009-06-26T18:22
at 2009-06-26T18:22
請問一個問題
By Ivy
at 2009-06-24T17:32
at 2009-06-24T17:32
關於 Mail Server
By Thomas
at 2009-06-16T17:11
at 2009-06-16T17:11