http_fetcher編譯問題 - BBS

Table of Contents


我自己寫了個.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;
}

--

All Comments