簡體   English   中英

編譯源代碼時出現cURLcpp錯誤

[英]cURLcpp error while compiling source

我對C ++和github的使用有點陌生。 我想在c ++中使用cURL功能。 因此,我首先從github分支了curlcpp(由JosephP91編寫),然后遵循其README.txt中的說明。

現在執行時出現錯誤

make # -j2

(帶或不帶-j2都沒有區別)。

錯誤:

[ 12%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_easy.cpp.o
In file included from /home/user/.git/curlcpp/src/curl_easy.cpp:6:0:
/home/user/.git/curlcpp/include/curl_easy.h:276:31: error: ‘CURLOPT_OBSOLETE72’ was not declared in this scope
         CURLCPP_DEFINE_OPTION(CURLOPT_OBSOLETE72, long); /* OBSOLETE, do not use! */
                               ^
/home/user/.git/curlcpp/include/curl_easy.h:47:33: note: in definition of macro ‘CURLCPP_DEFINE_OPTION’
     template <> struct option_t<opt> {\
                                 ^
/home/user/.git/curlcpp/include/curl_easy.h:47:36: error: template argument 1 is invalid
     template <> struct option_t<opt> {\
                                    ^
/home/user/.git/curlcpp/include/curl_easy.h:276:9: note: in expansion of macro ‘CURLCPP_DEFINE_OPTION’
         CURLCPP_DEFINE_OPTION(CURLOPT_OBSOLETE72, long); /* OBSOLETE, do not use! */
         ^
make[2]: *** [src/CMakeFiles/curlcpp.dir/curl_easy.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/curlcpp.dir/all] Error 2
make: *** [all] Errors 2

預先感謝你們對我的幫助!

編輯:

輸出

cmake

輸出:

-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found suitable version "7.35.0", minimum required is "7.28.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/.git/curlcpp/build

您需要在Ubuntu上將libcurl fron版本7.35.0更新到7.37.1,在utopic存儲庫( http://packages.ubuntu.com/utopic/libcurl4-nss-dev )上可以找到libcurl 7.31。

您可以使用apt-get進行更新:

echo "deb http://archive.ubuntu.com/ubuntu/ utopic main restricted" | sudo tee /etc/apt/sources.list
apt-get update
apt-get upgrade libcurl4-nss-dev

然后重做cmake並制作,它應該可以編譯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM