[問題] http_fetcher編譯問題

看板FreeBSD作者 (Sam)時間16年前 (2009/06/26 18:22), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/4 (看更多)
我自己寫了個.cpp, 自行指定安裝目錄(非預設目錄), 然而在寫測試程式編譯的時候有指定include dir和lib dir, 可是卻仍發生undefined reference問題(錯誤如下) 請問該如何解決? 謝謝告知~ g++ -I../include -L../lib -lhttp_fetcher t.cpp /var/tmp//ccjBAMrM.o(.text+0x12b): In function `main': : undefined reference to `http_fetch(char const*, char**)' ls ../include/ http_error_codes.h http_fetcher.h ls ../lib/ libhttp_fetcher.a libhttp_fetcher.la libhttp_fetcher.so libhttp _fetcher.so.2 CODE: #include <iostream> #include "../include/http_fetcher.h" using namespace std; int main() { char *fileBuf[4000]; http_fetch("http://www.yahoo.com.tw", fileBuf); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.101.165 ※ 編輯: sacanner 來自: 140.123.101.165 (06/26 18:23)
文章代碼(AID): #1AHA5IMn (FreeBSD)
文章代碼(AID): #1AHA5IMn (FreeBSD)