1

次の簡単な例で cURLpp を動作させることはできませんNo URL set!。簡略化されたコードは次のとおりです。

          curlpp::initialize(CURL_GLOBAL_ALL);

          curlpp::Easy easyhandle;
          easyhandle.setOpt(new curlpp::options::Url(std::string("http://example.com")));
          easyhandle.perform();

          curlpp::terminate();

次の方法で Url オプションを取り戻そうとすると、

          curlpp::options::Url o;
          easyhandle.getOpt(o);

次に、オブジェクトoは完全に問題ないようです。

      o @0x7ffeefbfed78 curlpp::options::Url
          [curlpp::Option<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >]  @0x7ffeefbfed78 curlpp::Option<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >
              [curlpp::OptionBase]  @0x7ffeefbfed78 curlpp::OptionBase
                  mOption   CURLOPT_URL (10002) CURLoption
              mContainer    @0x101837be0    curlpp::internal::OptionContainer<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >
                  mValue    "http://example.com"    curlpp::internal::OptionContainer<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ValueType
                      [0]   'h'     104     0x68    char
                      [1]   't'     116     0x74    char
                      [2]   't'     116     0x74    char
                      [3]   'p'     112     0x70    char
                      [4]   ':'     58      0x3a    char
                      [5]   '/'     47      0x2f    char
                      [6]   '/'     47      0x2f    char
                      [7]   'e'     101     0x65    char
                      [8]   'x'     120     0x78    char
                      [9]   'a'     97      0x61    char
                      [10]  'm'     109     0x6d    char
                      [11]  'p'     112     0x70    char
                      [12]  'l'     108     0x6c    char
                      [13]  'e'     101     0x65    char
                      [14]  '.'     46      0x2e    char
                      [15]  'c'     99      0x63    char
                      [16]  'o'     111     0x6f    char
                      [17]  'm'     109     0x6d    char

私の環境は次のとおりです。

  • macOS ビッグサー
  • libcurlpp 0.8.1_1
  • lib カール 7.80.0
4

0 に答える 0