我試圖使用Poco C++庫在Mac OS X 10.8.2上使用C++進行簡單的http請求。我安裝波科,複製粘貼的http_request.cc代碼this tutorial,以「G ++ -o HTTP_GET http_get.cc -lPocoNet」跑了,但得到:OSX 10.8.2上的Poco C++庫:架構x86_64上的未定義符號
Undefined symbols for architecture x86_64:
"Poco::StreamCopier::copyStream(std::basic_istream<char, std::char_traits<char> >&, std::basic_ostream<char, std::char_traits<char> >&, unsigned long)", referenced from:
_main in ccKuZb1g.o
"Poco::URI::URI(char const*)", referenced from:
_main in ccKuZb1g.o
"Poco::URI::~URI()", referenced from:
_main in ccKuZb1g.o
"Poco::URI::getPathAndQuery() const", referenced from:
_main in ccKuZb1g.o
"Poco::URI::getPort() const", referenced from:
_main in ccKuZb1g.o
"Poco::Exception::displayText() const", referenced from:
_main in ccKuZb1g.o
"typeinfo for Poco::Exception", referenced from:
GCC_except_table1 in ccKuZb1g.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
已與此掙扎幾個小時。任何想法如何解決這個問題?提前致謝!
這看起來好像你需要包含一些庫,例如'-lPocoNet'(我猜猜庫的名字,儘管如此)。 –