我正在尝试使用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 \卷曲\ curlpp-0.7.3.tar \ curlpp-0.7.3 \包括” “C:\ FinalProgrammingProjectData \卷曲\卷曲7.22.0-devel的-的mingw32 \卷曲7.22.0-devel的-的mingw32 \包括”
我已加入我的图书馆路径: “C:\ FinalProgrammingProjectData \卷曲\卷曲7.22.0-devel的-的mingw32 \ lib中”
在库选项卡下,我添加了位于其中的各个文件的名称: “C:\ FinalProgrammingProjectData \卷曲\卷曲7.22.0-devel的-的mingw32 \ lib中”
当我尝试构建我的项目时,我会遇到很多错误:
“未定义参考”
有谁知道我的问题可能是什么?我没有写任何自己的代码。我刚刚尝试编译cURLpp下载中包含的第一个示例。如果有人能提供任何见解,我将非常感激。我几个小时一直在努力,并没有取得多大进展。
谢谢
P.S。以下是包含错误列表的构建配置
构建项目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 -o curlTest.exe curlTest。 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: undefined reference to
imp ZlsRSoRKN6curlpp11OptionTraitISsL10CURLoption10002EEE'
C:\ Users \ Owner \ Desktop \ School \ Fall 2011 \ EEL3834 \ Eclipse Projects \ curlTest \ Debug /../ curlTest.cpp:37:ninefined 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:对_imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE'
curlTest.o: In function
OptionTrait'的未定义引用:
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:124:对_imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE'
curlTest.o: In function
~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: undefined reference to
_ 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: undefined reference to
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: undefined reference to
_ imp _ZN6curlpp10OptionBaseD2Ev'的未定义引用
curlTest.o:在函数Option':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:42: undefined reference to
imp ZN6curlpp10OptionBaseC2E10CURLoption'
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: undefined reference to
_ imp _ZN6curlpp10OptionBaseD2Ev'的未定义引用
curlTest.o:curlTest.cpp :(。rdata $ _ZTVN6curlpp11OptionTraitISsL10CURLoption10002EEE [vtable for curlpp :: OptionTrait,std :: allocator&gt;,(CURLoption)10002&gt;] + 0x10):未定义引用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&lt;(curlpp :: OptionBase const&amp;)const'
curlTest.o:在函数~UnsetOption':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/internal/../Exception.hpp:143: undefined reference to
imp ZN6curlpp12RuntimeErrorD2Ev'
curlTest.o:在函数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:在函数ZNK6curlpp11OptionTraitISsL10CURLoption10002EE16updateHandleToMeEPNS_8internal10CurlHandleE':
C:/FinalProgrammingProjectData/cURL/curlpp-0.7.3.tar/curlpp-0.7.3/include/curlpp/Option.inl:148: undefined reference to
imp ZN6curlpp11UnsetOptionC1ERKSs'
curlTest.o:在函数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:在函数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返回1退出状态
发生构建错误,构建停止
消耗时间:576毫秒。
答案 0 :(得分:0)
我决定不使用cURLpp。我让libcURL独立工作。 cURLpp和libcURL之间存在太多依赖关系。
由于