如何在Eclipse IDE中添加编译器选项

编程入门 行业动态 更新时间:2024-10-27 01:21:13
本文介绍了如何在Eclipse IDE中添加编译器选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在创建一个与天气API交互的应用程序,为此,我正在使用Poco的HTTPClientSession库,但是在编译时却遇到了错误

I'm creating an application that interfaces with a weather API, and to do so I'm using Poco's HTTPClientSession library, but I'm getting an error at compile time

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,因此我不确定如何在实现该效果的同时使用日食

I know from my research that this error is caused by a need for the option -lPocoNet to be used when calling the compiler, but I use the eclipse IDE, so I'm not sure how to implement the same effect while using eclipse

推荐答案

如果使用的是gcc,则可以转到Project \ Properties

If you are using gcc, you can go to Project \ Properties

在属性对话框中,转到"C/C ++ Build \设置\ GCC C ++编译器\其他",

In the properties dialog box, go to C/C++ Build\ Settings\GCC C++ Compiler\ Miscellaneous,

,然后将-lPocoNet添加到其他标志",如下所示.

and add -lPocoNet to "Other flags" as shown below.

更多推荐

如何在Eclipse IDE中添加编译器选项

本文发布于:2023-11-14 19:02:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1588276.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:编译器   选项   如何在   IDE   Eclipse

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!