cURLpp 和 Eclipse 的主要问题

发布于 2024-12-15 20:47:20 字数 5292 浏览 0 评论 0 原文

我正在尝试使用 cURLpp 作为从天气网站检索数据的途径,以用于我的 C++ 课程的最终项目。我使用 Eclipse 作为 IDE,使用 MinGW 作为编译器。我想要做的就是向天气 API 发送 GET 请求并检索返回的数据。我做了一些广泛的研究,看来 cURLpp 是正确的选择。

我花了几个小时尝试在 Eclipse 中配置它,但仍然遇到错误。我下载了 libcURL 和 cURLpp。我不确定我下载的版本是否正确。我下载的文件的名称是:

“curlpp-0.7.3.tar.gz”和“curl-7.22.0-devel-mingw32.zip”

下载这两个文件后,我将它们解压到任意目录。在 Eclipse 中,我添加到我的包含路径:

“C:\FinalProgrammingProjectData\cURL\curlpp-0.7.3.tar\curlpp-0.7.3\include” “C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\curl-7.22.0-devel-mingw32\include”

我添加到我的库路径中: “C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib”

在库选项卡下,我添加了位于其中的各个文件的名称: "C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib"

当我尝试构建我的项目时,我收到很多错误,内容大致如下:

“未定义的引用”

有人知道吗我的问题可能是什么?我没有编写任何自己的代码。我刚刚尝试编译 cURLpp 下载中包含的第一个示例。如果有人能够提供任何见解,我将不胜感激。我已经为此奋斗了几个小时,但没有取得太大进展。

谢谢 以下是包含错误列表的构建配置

构建项目curlTest的配置调试**

内部构建器用于构建** g++ -LC:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib -LC:\FinalProgrammingProjectData\cURL\curlpp-0.7.3.tar\curlpp-0.7.3\src -ocurlTest.execurlTest。 o -lcurl -lidn.dll -lrtmp -lssh2 -lssh2dll -lssl -lssl32 -lz -lzdll -leay32 -lidn -lcurldll -lcrypto curlTest.o:在函数 main' 中: C:\Users\Owner\Desktop\School\Fall 2011\EEL3834\Eclipse Projects\curlTest\Debug/../curlTest.cpp:32:未定义引用imp ZlsRSoRKN6curlpp11OptionTraitISsL10CURLoption10002EEE' C:\Users\Owner\Desktop\School\Fall 2011\EEL3834\Eclipse Projects\curlTest\Debug/../curlTest.cpp:37:对 _imp___ZlsRSoRKN6curlpp11OptionTraitISsL10CURLoption10002EEE 的未定义引用 curlTest.o:在函数中~OptionTrait': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.hpp:147:对 _imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE 的未定义引用 curlTest.o:在函数OptionTrait'中: C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:124:对 _imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE 的未定义引用 curlTest.o:在函数中~Option': C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71:对 _imp___ZTVN6curlpp6OptionISsEE' 的未定义引用 C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71:未定义引用_imp_ZN6curlpp10OptionBaseD2Ev' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71:对 _imp___ZN6curlpp10OptionBaseD2Ev' 的未定义引用 C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71:未定义引用impZTVN6curlpp6OptionISsEE ' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71:对 _imp___ZN6curlpp10OptionBaseD2Ev' 的未定义引用 C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71:未定义引用_imp_ZN6curlpp10OptionBaseD2Ev' curlTest.o:在函数 Option' 中: C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42:未定义引用impZN6curlpp10OptionBaseC2E10CURLoption ' C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42:对 _imp___ZTVN6curlpp6OptionISsEE' 的未定义引用 C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42:未定义引用_imp_ZN6curlpp10OptionBaseD2Ev' curlTest.o:curlTest.cpp:(.rdata$_ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE[curlpp::OptionTrait的vtable,std::allocator>,(CURLoption)10002>]+0x10):未定义的引用curlpp::OptionBase::operator<(curlpp::OptionBase const&) const' curlTest.o:curlTest.cpp:(.rdata$_ZTVN6curlpp6OptionISsEE[curlpp::Option, std::allocator>>的虚表]+0x10 ): 未定义的参考到 curlpp::OptionBase::operator<(curlpp::OptionBase const&) const' curlTest.o:在函数 ~UnsetOption' 中: C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/internal/../Exception.hpp:143:未定义引用impZN6curlpp12RuntimeErrorD2Ev' curlTest.o:在函数 ZN6curlpp6OptionISsE16updateMeToOptionERKNS_10OptionBaseE' 中: C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:96:未定义引用_imp_ZN6curlpp11UnsetOptionC1EPKc' curlTest.o:在函数 ZNK6curlpp11OptionTraitISsL10CURLoption10002EE16updateHandleToMeEPNS_8internal10CurlHandleE' 中: C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:148:未定义引用impZN6curlpp11UnsetOptionC1ERKSs ' curlTest.o:在函数 ZNK6curlpp6OptionISsE8getValueEv' 中: C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:114:未定义引用_imp_ZN6curlpp11UnsetOptionC1ERKSs' CurlTest.o:在函数 ZN6curlpp8internal10CurlHandle6optionIPvEEv10CURLoptionT_' 中: C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/internal/CurlHandle.inl:47:未定义引用imp__ZN6curlpp20libcurlRuntimeAssertEPKc8CURLcode' Collect2: ld 返回 1 退出状态 发生构建错误,构建停止 消耗时间:576 毫秒。

I am attempting to use cURLpp as an avenue for retrieving data from a weather website for a final project in my C++ class. I am using Eclipse as an IDE and MinGW as my compiler. All I want to be able to do is send a GET request to the weather API and retrieve the data that is returned. I have done some extensive research, and it appeared that cURLpp was the way to go.

I have spent hours trying to get it configured in Eclipse and I'm still getting errors. I downloaded both libcURL and cURLpp. I am not sure if the versions I downloaded are correct though. The names of the files I downloaded are:

"curlpp-0.7.3.tar.gz" and "curl-7.22.0-devel-mingw32.zip"

Once I downloaded these two files, I extracted them both to an arbitrary directory. In eclipse, I added to my Includes path:

"C:\FinalProgrammingProjectData\cURL\curlpp-0.7.3.tar\curlpp-0.7.3\include"
"C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\curl-7.22.0-devel-mingw32\include"

I added to my Library Paths:
"C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib"

Under the libraries tab, I added the names of the individual files that are located inside:
"C:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib"

When I try to build my project, I get alot of errors saying something along the lines of:

"undefined reference to"

Does anyone have any idea what my problem might be? I haven't written any of my own code. I've just been trying to compile the first example that is included with the cURLpp download. If anyone can offer any insight, I'd be most grateful. I have been wrestling with this for hours and haven't made much progress.

Thank You

P.S. Here is the build configuration with a list of the errors

Build of configuration Debug for project curlTest **

Internal Builder is used for build **
g++ -LC:\FinalProgrammingProjectData\cURL\curl-7.22.0-devel-mingw32\lib -LC:\FinalProgrammingProjectData\cURL\curlpp-0.7.3.tar\curlpp-0.7.3\src -o curlTest.exe curlTest.o -lcurl -lidn.dll -lrtmp -lssh2 -lssh2dll -lssl -lssl32 -lz -lzdll -leay32 -lidn -lcurldll -lcrypto
curlTest.o: In function main':
C:\Users\Owner\Desktop\School\Fall 2011\EEL3834\Eclipse Projects\curlTest\Debug/../curlTest.cpp:32: undefined reference to
impZlsRSoRKN6curlpp11OptionTraitISsL10CURLoption10002EEE'
C:\Users\Owner\Desktop\School\Fall 2011\EEL3834\Eclipse Projects\curlTest\Debug/../curlTest.cpp:37: undefined reference to _imp___ZlsRSoRKN6curlpp11OptionTraitISsL10CURLoption10002EEE'
curlTest.o: In function
~OptionTrait':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.hpp:147: undefined reference to _imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE'
curlTest.o: In function
OptionTrait':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:124: undefined reference to _imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE'
curlTest.o: In function
~Option':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to _imp___ZTVN6curlpp6OptionISsEE'
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to
_imp
_ZN6curlpp10OptionBaseD2Ev'
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to _imp___ZN6curlpp10OptionBaseD2Ev'
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to
impZTVN6curlpp6OptionISsEE'
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to _imp___ZN6curlpp10OptionBaseD2Ev'
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:71: undefined reference to
_imp
_ZN6curlpp10OptionBaseD2Ev'
curlTest.o: In function Option':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42: undefined reference to
impZN6curlpp10OptionBaseC2E10CURLoption'
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42: undefined reference to _imp___ZTVN6curlpp6OptionISsEE'
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42: undefined reference to
_imp
_ZN6curlpp10OptionBaseD2Ev'
curlTest.o:curlTest.cpp:(.rdata$_ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE[vtable for curlpp::OptionTrait, std::allocator >, (CURLoption)10002>]+0x10): undefined reference to curlpp::OptionBase::operator<(curlpp::OptionBase const&) const'
curlTest.o:curlTest.cpp:(.rdata$_ZTVN6curlpp6OptionISsEE[vtable for curlpp::Option<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]+0x10): undefined reference to
curlpp::OptionBase::operator<(curlpp::OptionBase const&) const'
curlTest.o: In function ~UnsetOption':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/internal/../Exception.hpp:143: undefined reference to
impZN6curlpp12RuntimeErrorD2Ev'
curlTest.o: In function ZN6curlpp6OptionISsE16updateMeToOptionERKNS_10OptionBaseE':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:96: undefined reference to
_imp
_ZN6curlpp11UnsetOptionC1EPKc'
curlTest.o: In function ZNK6curlpp11OptionTraitISsL10CURLoption10002EE16updateHandleToMeEPNS_8internal10CurlHandleE':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:148: undefined reference to
impZN6curlpp11UnsetOptionC1ERKSs'
curlTest.o: In function ZNK6curlpp6OptionISsE8getValueEv':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:114: undefined reference to
_imp
_ZN6curlpp11UnsetOptionC1ERKSs'
curlTest.o: In function ZN6curlpp8internal10CurlHandle6optionIPvEEv10CURLoptionT_':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/internal/CurlHandle.inl:47: undefined reference to
imp__ZN6curlpp20libcurlRuntimeAssertEPKc8CURLcode'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 576 ms.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千と千尋 2024-12-22 20:47:20

我决定不使用 cURLpp。我让 libcURL 可以独立工作。 cURLpp 和 libcURL 之间存在太多依赖关系。

谢谢

I decided against using cURLpp. I got libcURL to work on its own. There were just too many dependencies between cURLpp and libcURL.

Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文