【问题标题】:How to add compiler options in Eclipse IDE如何在 Eclipse IDE 中添加编译器选项
【发布时间】:2014-10-15 07:28:43
【问题描述】:

我正在创建一个与天气 API 接口的应用程序,为此我使用 Poco 的 HTTPClientSession 库,但在编译时出现错误

Undefined symbols for architecture x86_64:
"Poco::Net::HTTPRequest::setHost(std::__1::basic_string<char,std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
  Weather::getCSV() in Weather.o
"Poco::Net::HTTPRequest::HTTPRequest()", referenced from:
  Weather::getCSV() in Weather.o
"Poco::Net::HTTPRequest::~HTTPRequest()", referenced from:
  Weather::getCSV() in Weather.o
"Poco::Net::HTTPResponse::HTTPResponse()", referenced from:
  Weather::getCSV() in Weather.o
"Poco::Net::HTTPResponse::~HTTPResponse()", referenced from:
  Weather::getCSV() in Weather.o
"Poco::Net::HTTPClientSession::sendRequest(Poco::Net::HTTPRequest&)", referenced from:
  Weather::getCSV() in Weather.o
"Poco::Net::HTTPClientSession::HTTPClientSession(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned short)", referenced from:
  Weather::getCSV() in Weather.o
"Poco::Net::HTTPClientSession::~HTTPClientSession()", referenced from:
  Weather::getCSV() in Weather.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我从我的研究中知道这个错误是由于调用编译器时需要使用选项-lPocoNet引起的,但是我使用的是eclipse IDE,所以我不确定如何实现相同的效果同时使用日食

【问题讨论】:

    标签: c++ eclipse poco


    【解决方案1】:

    如果你使用gcc,你可以去Project\Properties

    在属性对话框中,进入C/C++ Build\Settings\GCC C++ Compiler\Miscellaneous,

    并将-lPocoNet 添加到“其他标志”,如下所示。

    【讨论】:

      猜你喜欢
      • 2011-09-23
      • 2014-10-30
      • 2018-04-27
      • 2019-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多