0

I am kinda new to c++ and the use of github. I want to use cURL functionality in c++. Therefore I first forked curlcpp (by JosephP91) from github, and then followed the instructions from its README.txt.

Now I get an Error when executing

make # -j2

(with or without -j2 makes no difference).

The error:

[ 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

Thank you guys in advance for helping me!

EDIT:

Output of

cmake

Output:

-- 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
3
  • can you give cmake output, I tested with JosephP91 repository and it compile just fine for me Commented May 12, 2015 at 11:38
  • thanks for the quick response! i added the output Commented May 12, 2015 at 23:11
  • I'm able to reproduce the problem in ubuntu, I think the problem is the libcurl version, I gonna upgrade and come back to you Commented May 13, 2015 at 7:44

1 Answer 1

1

You need to update libcurl fron version 7.35.0 to 7.37.1 on Ubuntu, libcurl 7.31 is available on the utopic repository (http://packages.ubuntu.com/utopic/libcurl4-nss-dev).

You can use apt-get to update by doing:

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

and then redo cmake and make and it should compile just fine.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot! This solved the problem! But the first command you provided didn't work for me (no diff with sudo), so i did it this way: 'echo "deb archive.ubuntu.com/ubuntu utopic main restricted" | sudo tee -a /etc/apt/sources.list' (first backup the sources.list)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.