作者sacanner (Sam)
看板FreeBSD
标题[问题] http_fetcher编译问题
时间Fri Jun 26 18:22:09 2009
我自己写了个.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)