An object oriented C++ wrapper for CURL (libcurl)

Overview

curlcpp

An object-oriented C++ wrapper for cURL tool

If you want to know a bit more about cURL and libcurl, you should go on the official website http://curl.haxx.se/

Donate

Help me to improve this project!

paypal

Compile and link

Standalone

cd build
cmake ..
make # -j2

Note: cURL >= 7.34 is required.

Then add <curlcpp root>/build/src/ to your library path and <curlcpp root>/include/ to your include path.

When linking, link against curlcpp (e.g.: g++ -std=c++11 example.cpp -o example -lcurlcpp -lcurl). Or if you want run from terminal,

g++ -std=c++11 example.cpp -L/home/username/path/to/build/src/ -I/home/username/path/to/include/ -lcurlcpp -lcurl

Submodule

When using a git submodule and CMake-buildsystem, add the following lines to your CMakeLists.txt:

ADD_SUBDIRECTORY(ext/curlcpp) # Change `ext/curlcpp` to a directory according to your setup
INCLUDE_DIRECTORIES(${CURLCPP_SOURCE_DIR}/include)

Simple usage example

Here are some usage examples. You will find more examples in the test folder!

Here's an example of a simple HTTP request to get google web page, using the curl_easy interface:

#include "curl_easy.h"

using curl::curl_easy;
using curl::curl_easy_exception;
using curl::curlcpp_traceback;

/**
 * This example shows how to make a simple request with curl.
 */
int main() {
    // Easy object to handle the connection.
    curl_easy easy;

    // Add some options.
    easy.add<CURLOPT_URL>("http://<your_url_here>");
    easy.add<CURLOPT_FOLLOWLOCATION>(1L);

    try {
        easy.perform();
    } catch (curl_easy_exception &error) {
    	// If you want to print the last error.
        std::cerr<<error.what()<<std::endl;
    }
    return 0;
}

If you want to get information about the current curl session, you could do:

#include "curl_easy.h"
#include "curl_ios.h"
#include "curl_exception.h"

using std::ostringstream;

using curl::curl_easy;
using curl::curl_easy_exception;
using curl::curlcpp_traceback;
using curl::curl_ios;

/**
 * This example shows how to use the easy interface and obtain
 * informations about the current session.
 */
int main(int argc, const char **argv) {
    // Let's declare a stream
    ostringstream stream;

    // We are going to put the request's output in the previously declared stream
    curl_ios<ostringstream> ios(stream);

    // Declaration of an easy object
    curl_easy easy(ios);

    // Add some option to the curl_easy object.
    easy.add<CURLOPT_URL>("http://<your_url_here>");
    easy.add<CURLOPT_FOLLOWLOCATION>(1L);

    try {
        easy.perform();

		// Retrieve information about curl current session.
		auto x = easy.get_info<CURLINFO_CONTENT_TYPE>();

		/**
		 * get_info returns a curl_easy_info object. With the get method we retrieve
		 * the std::pair object associated with it: the first item is the return code of the
		 * request. The second is the element requested by the specified libcurl macro.
		 */
		std::cout<<x.get()<<std::endl;

    } catch (curl_easy_exception &error) {
		// If you want to print the last error.
		std::cerr<<error.what()<<std::endl;

		// If you want to print the entire error stack you can do
		error.print_traceback();
    }
    return 0;
}

Here's instead, the creation of an HTTPS POST login form:

#include <string>

#include "curl_easy.h"
#include "curl_pair.h"
#include "curl_form.h"
#include "curl_exception.h"

using std::string;

using curl::curl_form;
using curl::curl_easy;
using curl::curl_pair;
using curl::curl_easy_exception;
using curl::curlcpp_traceback;

int main(int argc, const char * argv[]) {
    curl_form form;
    curl_easy easy;

    // Forms creation
    curl_pair<CURLformoption,string> name_form(CURLFORM_COPYNAME,"user");
    curl_pair<CURLformoption,string> name_cont(CURLFORM_COPYCONTENTS,"you username here");
    curl_pair<CURLformoption,string> pass_form(CURLFORM_COPYNAME,"passw");
    curl_pair<CURLformoption,string> pass_cont(CURLFORM_COPYCONTENTS,"your password here");
    
    try {
        // Form adding
        form.add(name_form,name_cont);
        form.add(pass_form,pass_cont);
        
        // Add some options to our request
        easy.add<CURLOPT_URL>("http://<your_url_here>");
        easy.add<CURLOPT_SSL_VERIFYPEER>(false);
        easy.add<CURLOPT_HTTPPOST>(form.get());
        // Execute the request.
        easy.perform();

    } catch (curl_easy_exception &error) {
        // If you want to get the entire error stack we can do:
        curlcpp_traceback errors = error.get_traceback();
        // Otherwise we could print the stack like this:
        error.print_traceback();
    }
    return 0;
}

And if we would like to put the returned content in a file? Nothing easier than:

#include <iostream>
#include <ostream>
#include <fstream>

#include "curl_easy.h"
#include "curl_ios.h"
#include "curl_exception.h"

using std::cout;
using std::endl;
using std::ostream;
using std::ofstream;

using curl::curl_easy;
using curl::curl_ios;
using curl::curl_easy_exception;
using curl::curlcpp_traceback;

int main(int argc, const char * argv[]) {
    // Create a file
    ofstream myfile;
    myfile.open ("/path/to/your/file");
    
    // Create a curl_ios object to handle the stream
    curl_ios<ostream> writer(myfile);
    // Pass it to the easy constructor and watch the content returned in that file!
    curl_easy easy(writer);
    
    // Add some option to the easy handle
    easy.add<CURLOPT_URL>("http://<your_url_here>");
    easy.add<CURLOPT_FOLLOWLOCATION>(1L);
    try {
        // Execute the request
        easy.perform();

    } catch (curl_easy_exception &error) {
		// If you want to print the last error.
		std::cerr<<error.what()<<std::endl;

		// If you want to print the entire error stack you can do
		error.print_traceback();
    }
    myfile.close();
    return 0;
}

Not interested in files? So let's put the request's output in a variable!

#include <iostream>
#include <ostream>

#include "curl_easy.h"
#include "curl_form.h"
#include "curl_ios.h"
#include "curl_exception.h"

using std::cout;
using std::endl;
using std::ostringstream;

using curl::curl_easy;
using curl::curl_ios;
using curl::curl_easy_exception;
using curl::curlcpp_traceback;

int main() {
    // Create a stringstream object
    ostringstream str;
    // Create a curl_ios object, passing the stream object.
    curl_ios<ostringstream> writer(str);
    
    // Pass the writer to the easy constructor and watch the content returned in that variable!
    curl_easy easy(writer);
    // Add some option to the easy handle
    easy.add<CURLOPT_URL>("http://<your_url_here>");
    easy.add<CURLOPT_FOLLOWLOCATION>(1L);

    try {
        easy.perform();

        // Let's print the stream content
        cout<<str.str()<<endl;

    } catch (curl_easy_exception &error) {
		// If you want to print the last error.
		std::cerr<<error.what()<<std::endl;

		// If you want to print the entire error stack you can do
		error.print_traceback();
    }
    return 0;
}

I have implemented a sender and a receiver to make it easy to use send/receive without handling buffers. For example, a very simple send/receiver would be:

#include <iostream>
#include <string>

#include "curl_easy.h"
#include "curl_form.h"
#include "curl_pair.h"
#include "curl_receiver.h"
#include "curl_exception.h"
#include "curl_sender.h"

using std::cout;
using std::endl;
using std::string;

using curl::curl_form;
using curl::curl_easy;
using curl::curl_sender;
using curl::curl_receiver;
using curl::curl_easy_exception;
using curl::curlcpp_traceback;

int main(int argc, const char * argv[]) {
    // Simple request
    string request = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n";
    // Creation of easy object.
    curl_easy easy;
    try {
        easy.add<CURLOPT_URL>("http://<your_url_here>");
        // Just connect
        easy.add<CURLOPT_CONNECT_ONLY>(true);
        // Execute the request.
        easy.perform();

    } catch (curl_easy_exception &error) {
        // If you want to get the entire error stack we can do:
        curlcpp_traceback errors = error.get_traceback();
        // Otherwise we could print the stack like this:
        error.print_traceback();
    }
    
    // Creation of a sender. You should wait here using select to check if socket is ready to send.
    curl_sender<string> sender(easy);
    sender.send(request);
    // Prints che sent bytes number.
    cout<<"Sent bytes: "<<sender.get_sent_bytes()<<endl;

    for(;;) {
        // You should wait here to check if socket is ready to receive
        try {
            // Create a receiver
            curl_receiver<char, 1024> receiver;
            // Receive the content on the easy handler
            receiver.receive(easy);
            // Prints the received bytes number.
            cout<<"Receiver bytes: "<<receiver.get_received_bytes()<<endl;

        } catch (curl_easy_exception &error) {
            // If any errors occurs, exit from the loop
            break;
        }
    }
    return 0;
}
Issues
  • Thread Safety : curl_exception's get_traceback's copy is not protected

    Thread Safety : curl_exception's get_traceback's copy is not protected

    Hi,

    There may be a small problem if curlcpp is used from several threads. Since the curl_exception's traceback is a static vector, you will have an issue if the get_traceback function's return value is being copied and an insert happens to the vector that results in the container being reallocated. This will result in a pretty nasty crash because the previous vector element memory is likely invalid now.

    For example, say there are 3 elements in traceback. 1 has been copied in get_traceback and then an insert happens from another thread which causes the vector to reallocate. In this case, the 1 element that was copied is going to be invalid memory.

    It would be better to provide a new function that takes a vector as an output parameter and use the tracebackLocker to lock the std::copy operation. You can then mark the current function as not thread-safe. Alternatively, can traceback be a non-static member?

    opened by vivshankar 16
  • Release:1.2 Cmake fails.

    Release:1.2 Cmake fails.

    Following instructions: made a "build" directory. Cd into it. cmake .., and get greeted by this:

    -- IPO / LTO supported, will enable for targets in release build type
    You have called ADD_LIBRARY for library curlcpp without any source files. This typically indicates a problem with your CMakeLists.txt file
    CMake Error: Could not open file for write in copy operation /curlcppConfig.cmake.tmp
    CMake Error: : System Error: Permission denied
    CMake Error at CMakeLists.txt:37 (configure_file):
      configure_file Problem configuring file
    
    
    -- Configuring incomplete, errors occurred!
    

    Running on Linux Mint 19 | Cmake: 3.10.2

    Testing release 1.1: and cmake runs fine.

    opened by LCWilliams 15
  • 'NOEXCEPT' does not name a type

    'NOEXCEPT' does not name a type

    When I compile curlcpp on Windows with MinGW I get the following error:

    $ make
    Scanning dependencies of target curlcpp
    [ 12%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_easy.cpp.obj
    [ 25%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_header.cpp.obj
    In file included from C:/curlcpp/src/curl_head
    er.cpp:6:0:
    C:/curlcpp/include/curl_header.h:66:22: error:
     expected ';' at end of member declaration
             ~curl_header() NOEXCEPT;
                          ^
    C:/curlcpp/include/curl_header.h:66:24: error:
     'NOEXCEPT' does not name a type
             ~curl_header() NOEXCEPT;
                            ^
    make[2]: *** [src/CMakeFiles/curlcpp.dir/curl_header.cpp.obj] Error 1
    make[1]: *** [src/CMakeFiles/curlcpp.dir/all] Error 2
    make: *** [all] Error 2
    

    How can I fix this?

    opened by antonlukyanov 14
  • Build of 1.4 fail with mingw32 in win10 and curl 7.74.0

    Build of 1.4 fail with mingw32 in win10 and curl 7.74.0

    Hello. I tried to compile the library (latest master branch and tag1.4) in Windows 10 with mingw32 and (latest) curl 7.74.0 (x32 and x64). The curl is downloaded from https://curl.se/windows/.

    The static library libcurlcpp.a is created with no problem.

    But when it tries to link with recv_header_example_exec.exe (or other programs) it get undefined reference errors. I've included the compile procedure's log below for commit-tag 1.4 with curl compilex32URFail.log

    When trying to link with curl 7.74.0 x64 I get similar issues. Same when linking with the libcurl.dll.a.

    If anyone could check it it would be nice. Thanks.

    opened by terablade2001 12
  • Problem linking curlcpp in Ubuntu 16.04

    Problem linking curlcpp in Ubuntu 16.04

    Good evening (again),

    I would be making this thread unless I had exhausted all my other options.

    I've been trying to compile my code in my new Ubuntu 16.04 server but I keep getting the same error every time:

    /usr/lib/ld: cannot find -lcurlcpp collect2: error: ld returned 1 exit status

    Is there any work around for this? (Unfortunately I don't have the option to upgrade my server). (I've run the installation that you provide without any error)

    Thanks in advance, Stavros

    opened by stav121 10
  • getinfo for curl_easy interface

    getinfo for curl_easy interface

    Perhaps I miss something while searching the source but is there a way to use getinfo (https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html) from the curl easy interface? I am particularly trying to get the status code of a request after calling perform.

    opened by AlexGoico 10
  • missing: CURL_LIBRARY CURL_INCLUDE_DIR

    missing: CURL_LIBRARY CURL_INCLUDE_DIR

    I'm new to curl, I hope anyone could help to solve this I have installed curl from http://www.confusedbycode.com/curl/ when I'm trying cmake for visual studio v12 2013..I'm getting following error

    missing: CURL_LIBRARY CURL_INCLUDE_DIR

    This is the cmake log: The C compiler identification is MSVC 18.0.30723.0 The CXX compiler identification is MSVC 18.0.30723.0 Check for working C compiler using: Visual Studio 12 2013 Win64 Check for working C compiler using: Visual Studio 12 2013 Win64 -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler using: Visual Studio 12 2013 Win64 Check for working CXX compiler using: Visual Studio 12 2013 Win64 -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message): Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) Call Stack (most recent call first): C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE) C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindCURL.cmake:61 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:7 (FIND_PACKAGE)

    Configuring incomplete, errors occurred!

    opened by chrisnhans 10
  • Sending JSON data over POST

    Sending JSON data over POST

    Hi, i'm tring to send json data over POST:

    Here's my code

    curl_easy easy;
    curl_header header;
    header.add("Content-Type: application/json");
    easy.add(curl_pair<CURLoption,curl_header>(CURLOPT_HTTPHEADER, header));
    easy.add(curl_pair<CURLoption,string>(CURLOPT_URL, "http://localhost:3000/activePlayers"));
    easy.add(curl_pair<CURLoption,string>(CURLOPT_HTTPPOST,a));
    try {
        easy.perform();
    } catch (curl_easy_exception error) {
        // Print errors, if any
        error.print_traceback();
    }
    

    I get the following error:

    ERROR: Out of memory ::::: FUNCTION: perform

    Any idea how to set the application/json header and send JSON over POST ?

    opened by edi9999 9
  • problem with CURLOPT_POSTFIELDS not working

    problem with CURLOPT_POSTFIELDS not working

    This fails: easy.add(curl_pair<CURLoption, string>(CURLOPT_POSTFIELDS, "This will fail")); easy.perform();

    I think this is because the scope of the string only lasts as long as the call, but internally a pointer is kept to the raw string data. You probably should take an internal copy of the string somewhere before converting it to a C char buffer.

    I'm not sure if this applies to other calls too....

    To get this to work correctly I had to do this: const std::string data("This will work"); easy.add(curl_pair<CURLoption, string>(CURLOPT_POSTFIELDS, data)); easy.perform():

    opened by pixiepoop 9
  • Modern CMake support

    Modern CMake support

    Hello, I'm interested in using the library however I want to have 2 things: modern C++ and modern CMake. The first one is rather trivial to find info about but the second is (still) rather hard to encounter.

    So what I mean by modern CMake is:

    • Any project that needs library foobar should be enough to just write target_link_libraries(project_name PRIVATE foobar). If there are any compiler/linker flags missing that's the library's fault.
    • foobar should never touch any global CMake variables (CMAKE_*) as changing any can corrupt the build of the whole dependency tree. It should instead declare everything through target_* CMake functions as either PUBLIC or PRIVATE requirement.

    This repository contains rather old CMake recipe, so I'm asking whether you are interested in any PRs. The would bump the minimum required CMake version significantly.

    opened by Xeverous 7
  • memory corruption possibly caused by curl_easy

    memory corruption possibly caused by curl_easy

    We are having a memory corruption problem that seems to be caused by the creation of the curl_easy object on the stack. If we return string() immediately after creating the object, we see memory corruption. If we return before creating the object, the corruption doesn't occur. We also note problems and crashes with gethostname (see stack trace below). These tests are being run on Ubnutu 14.02 Linux and with gcc 4.8.4.

    const std::string TestClass::SendRequest(const string &request) { LOG(LogLevel::Debug, request);

            // Create a ostringstream object to receive the response body
            ostringstream body_var;
            ostringstream header_var;
    
            // The "body" stream will put the body content into "body_var"
            curl_ios<ostringstream> body(body_var);
    
            // The "header" stream will put the headers into "header_var"
            curl_ios<ostringstream> header(header_var);
    
            // Easy object to handle the connection.
            curl_easy easy;
    
            return string();
    

    } #0 __tsearch ([email protected]=0x7fffeb5eaf58, [email protected]=0x2500435455002e28,

    [email protected]=0x7ffff4e4c610 <known_compare>) at tsearch.c:250 #1 0x00007ffff4e4d21f in __GI___nss_lookup_function ([email protected]=0x2500435455002e00,

    [email protected]=0x7ffff4eae5e3 "gethostbyname4_r") at nsswitch.c:468 #2 0x00007ffff4dfc6a2 in gaih_inet (name=, service=, req=, pai=,

    naddrs=) at ../sysdeps/posix/getaddrinfo.c:841 #3 0x00000000000003c2 in ?? () #4 0x0000000000000002 in ?? () #5 0x0000000000000000 in ?? ()

    (gdb)

    opened by ncalad 7
  • Can't link with a project with Dynamic CRT (VS2019)

    Can't link with a project with Dynamic CRT (VS2019)

    I've installed your lib through NuGet (curlcpp-vc140-static-32_64 1.0.2) in VS2019, and tried to link with it my project (DLL) which uses CRT as a dynamic library. The build failed with multiple linking errors like this one:

    curlcpp.lib(cookie_time.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary':
       value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in Mask.obj
    

    Do you plan to provide a NuGet packaged with support of Dynamic CRT?

    opened by Anton-V-K 0
  • replece curlcpp-master/include to curlcpp-master/include/curlcpp

    replece curlcpp-master/include to curlcpp-master/include/curlcpp

    When I used this library on Visual Studio Code, I faced with a problem with using auto complete words. I suggest replece curlcpp-master/include/ directory to curlcpp-master/include/curlcpp/ this will very help a lot for simplify programming.

    opened by FrolovRuslan1 0
  • Singleton initializer issue

    Singleton initializer issue

    Hi, im trying to do something similar to the recv_header.cpp example but inside of a class.

    I have no issue with compile/link but when running my class i get memory issues here:

    // curl_interface.h
    // Implementation of the singleton initializer
    template<class T> curl_interface<T>::global_initializer::global_initializer(const long flag) {
        const CURLcode code = curl_global_init(flag);
        if (code != CURLE_OK) {
            throw curl_easy_exception(code,__FUNCTION__);
        }
    }
    
    Exception has occurred: W32/0xC0000374
    Unhandled exception at 0x00007FFCC208F199 (ntdll.dll) in main.exe: 0xC0000374
    

    My class is like:

    class CurlCppClient
    {
      private:
        std::ostringstream body_var;
        std::ostringstream header_var;
        curl::curl_ios<std::ostringstream> body;
        curl::curl_ios<std::ostringstream> header;
        curl::curl_easy curl_handler;
        ....
      public:
        ...
    }
    
    CurlCppClient::CurlCppClient()
      : body{header_var}, header{body_var}
    {
      curl_handler.add<CURLOPT_WRITEFUNCTION>(header.get_function());
      curl_handler.add<CURLOPT_HEADERDATA>(header.get_stream());
      curl_handler.add<CURLOPT_WRITEDATA>(body.get_stream());
      ...
    }
    

    I have no issue if I only use one std::ostringstream like in easy_info.cpp but once i add the second std::ostringstream (even if i dont set the write function) it fails at the singleton.

    Any ideas?

    opened by pipawoz 0
  • Can't link on windows

    Can't link on windows

    Hello. Im trying to build a project using curlcpp on windows (with makefile). I dont have the same issue on linux with -lcurl, only windows.

    I have libcurl_a.lib (static 7.79) and the src/inc files of curlcpp that i want to compile (without using curlcpp.lib) and my file structure is this:

    libs
    ├── 32
    │   └── libcurl_a.lib
    ├── 64
    │   └── libcurl_a.lib
    ├── curl
    │   ├── curl.h
    │   ├── curlver.h
    │   ├── easy.h
    │   ├── mprintf.h
    │   ├── multi.h
    │   ├── options.h
    │   ├── stdcheaders.h
    │   ├── system.h
    │   ├── typecheck-gcc.h
    │   └── urlapi.h
    ├── cookie.cpp
    ├── cookie_date.cpp
    ├── cookie_date.h
    ├── cookie_datetime.cpp
    ├── cookie_datetime.h
    ├── cookie.h
    ├── cookie_time.cpp
    ├── cookie_time.h
    ├── curl_config.h
    ├── curl_cookie.cpp
    ├── curl_cookie.h
    ├── curl_easy.cpp
    ├── curl_easy.h
    ├── curl_easy_info.h
    ├── curl_exception.cpp
    ├── curl_exception.h
    ├── curl_form.cpp
    ├── curl_form.h
    ├── curl_global.cpp
    ├── curl_global.h
    ├── curl_header.cpp
    ├── curl_header.h
    ├── curl_info.cpp
    ├── curl_info.h
    ├── curl_interface.h
    ├── curl_ios.h
    ├── curl_multi.cpp
    ├── curl_multi.h
    ├── curl_option.h
    ├── curl_pair.h
    ├── curl_receiver.h
    ├── curl_sender.h
    ├── curl_share.cpp
    ├── curl_share.h
    └── curl_utility.h
    

    On my makefile i included this lines

    DIRS += $(CURLCPP_DIR) $(CURLCPP_DIR)/curl (for includes for compiler) LIB_CURL = $(CURLCPP_DIR)/32 (or 64) LDFLAGS += ../$(LIB_CURL)/libcurl_a.lib Crypt32.lib Wldap32.lib Normaliz.lib ws2_32.lib winmm.lib (for linking)

    The makefile calls vcvarsall for compile/link. While compile doesnt have issues, i got the following error at the linking stage:

    vcvarsall.bat x86 & link -OUT:..\target\32\mydll.dll ..\int\mydll\32\dev\mydll.o \int\mydll\32\dev\libs\curlcpp\cookie.o ..\int\mydll\32\dev\libs\curlcpp\cookie_date.o ..\int\mydll\32\dev\libs\curlcpp\cookie_datetime.o ..\int\mydll\32\dev\libs\curlcpp\cookie_time.o ..\int\mydll\32\dev\libs\curlcpp\curl_cookie.o ..\int\mydll\32\dev\libs\curlcpp\curl_easy.o ..\int\mydll\32\dev\libs\curlcpp\curl_exception.o ..\int\mydll\32\dev\libs\curlcpp\curl_form.o ..\int\mydll\32\dev\libs\curlcpp\curl_global.o ..\int\mydll\32\dev\libs\curlcpp\curl_header.o ..\int\mydll\32\dev\libs\curlcpp\curl_info.o ..\int\mydll\32\dev\libs\curlcpp\curl_multi.o ..\int\mydll\32\dev\libs\curlcpp\curl_share.o -MACHINE:X86 -DLL ../dev/libs/curlcpp/32/libcurl_a.lib Crypt32.lib Wldap32.lib Normaliz.lib ws2_32.lib winmm.lib libcmt.lib Shlwapi.lib Setupapi.lib advapi32.lib ole32.lib user32.lib ws2_32.lib -DEF:..\dev\mydll.def -DCURL_INCLUDE_DIR=dev/libs/curlcpp/curl ../dev/libs/curlcpp/32/libcurl_a.lib Crypt32.lib Wldap32.lib Normaliz.lib ws2_32.lib winmm.lib
    
    curl_multi.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_share.o : error LNK2001: símbolo externo [email protected] sin resolver
    comm_client.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_cookie.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_easy.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_global.o : error LNK2001: símbolo externo [email protected] sin resolver
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_strerror
    curl_cookie.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_easy_info<struct curl_slist *>::~curl_easy_info<struct curl_slist *>(void)" ([email protected][email protected]@@[email protected]@[email protected])
    curl_header.o : error LNK2001: símbolo externo [email protected] sin resolver
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_slist_free_all
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_easy::escape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected][email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_escape
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_easy::unescape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected][email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_unescape
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "private: static __stdcall <lambda_51d2c2f2d2b174c4d61844a9860c136f>::<lambda_invoker_stdcall>(char *)" (?<lambda_invoker_stdcall>@<lambda_51d2c2f2d2b174c4d61844a9860c136f>@@[email protected]@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_free
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_interface<enum CURLcode>::global_initializer::global_initializer(long)" ([email protected][email protected]@@@[email protected]@[email protected]@Z)
    curl_global.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_multi.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_share.o : error LNK2001: símbolo externo [email protected] sin resolver
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_global_init
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_interface<enum CURLcode>::global_initializer::~global_initializer(void)" ([email protected][email protected]@@@[email protected]@[email protected])
    curl_global.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_multi.o : error LNK2001: símbolo externo [email protected] sin resolver
    curl_share.o : error LNK2001: símbolo externo [email protected] sin resolver
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_global_cleanup
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_easy::pause(int)" ([email protected][email protected]@@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_pause
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_easy::curl_easy(long)" ([email protected]@@[email protected]@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_init
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_easy::perform(void)" ([email protected][email protected]@@QAEXXZ)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_perform
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_easy::curl_easy(class curl::curl_easy const &)" ([email protected]@@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_cleanup
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_easy::curl_easy(class curl::curl_easy const &)" ([email protected]@@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_duphandle
    curl_easy.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_easy::reset(void)" ([email protected][email protected]@@QAEXXZ)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_easy_reset
    curl_form.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_form::~curl_form(void)" ([email protected]@@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_formfree
    curl_header.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: class curl::curl_header & __thiscall curl::curl_header::operator=(class curl::curl_header const &)" ([email protected]@@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_slist_append
    curl_info.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_info::curl_info(enum CURLversion)" ([email protected]@@[email protected]@@@Z)
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_multi::curl_multi(long)" ([email protected]@@[email protected]@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_init
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_multi::add(class curl::curl_easy const &)" ([email protected][email protected]@@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_add_handle
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_multi::remove(class curl::curl_easy const &)" ([email protected][email protected]@@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_remove_handle
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_multi::set_descriptors(struct fd_set *,struct fd_set *,struct fd_set *,int *)" ([email protected][email protected]@@[email protected]@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_fdset
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_multi::wait(struct curl_waitfd * const,unsigned int,int,int *)" ([email protected][email protected]@@[email protected]@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_wait
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: bool __thiscall curl::curl_multi::perform(void)" ([email protected][email protected]@@QAE_NXZ)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_perform
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: class std::unique_ptr<void,struct curl::curl_multi::multi_deleter> & __thiscall std::unique_ptr<void,struct curl::curl_multi::multi_deleter>::operator=<struct curl::curl_multi::multi_deleter,0>(class std::unique_ptr<void,struct curl::curl_multi::multi_deleter> &&)" ([email protected][email protected]@@[email protected]@[email protected][email protected][email protected]@@@[email protected]@[email protected][email protected]@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_cleanup
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: class std::unique_ptr<class curl::curl_multi::curl_message,struct std::default_delete<class curl::curl_multi::curl_message> > __thiscall curl::curl_multi::get_info(class curl::curl_easy const &)" ([email protected][email protected]@@[email protected][email protected][email protected]@@[email protected][email protected][email protected]@@@[email protected]@@[email protected]@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_info_read
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_multi_exception::curl_multi_exception(enum CURLMcode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@@[email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_strerror
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: bool __thiscall curl::curl_multi::socket_action(unsigned int,int)" ([email protected][email protected]@@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_socket_action
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_multi::timeout(long *)" ([email protected][email protected]@@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_timeout
    curl_multi.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: void __thiscall curl::curl_multi::assign(unsigned int,void *)" ([email protected][email protected]@@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_multi_assign
    curl_share.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "protected: void __thiscall curl::curl_share::initialize_curl_share(void)" ([email protected][email protected]@@IAEXXZ)
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_share_init
    curl_share.o : error LNK2019: símbolo externo [email protected] sin resolver al que se hace referencia en la función "public: virtual __thiscall curl::curl_share::~curl_share(void)" ([email protected]@@[email protected])
      Sugerencia sobre los símbolos definidos que podrían coincidir:
        _curl_share_cleanup
    ..\target\32\mydll.dll : fatal error LNK1120: 30 externos sin resolver
    make: *** [../target/32/mydll.dll] Error 1120
    

    I know that linking gets the libcurl lib because if i change the name/misspell it gives lib not found. Sorry i cant provide the full makefile and spanish language on the errors but are external/unresolved symbol.

    Any ideas? I know that building curlcpp.lib is another option but im having issues with visual studio solution and x86 building conflicts.

    opened by themachho 2
  • NOEXCEPT

    NOEXCEPT

    I don't get the use of NOEXCEPT macro

    https://github.com/JosephP91/curlcpp/blob/0c2f06df81c6cb24fad11fd12d69a2dd19360285/include/curl_config.h#L25-L35

    • noexcept is a mandatory language feature and a conforming C++11 compiler must support it
    • <ciso646> has been removed in C++20, so a conforming implementation may actually fail to build
    • The __curlcpp__curl_config__ is technically undefined behavior (any names containing __, especially the ones starting with double underscore or an underscore + uppercase letter are reserved for the implementation) - this is obviously very unlikely to cause problems, but mentioning this in case you care for maximum conformance.
    opened by Xeverous 0
  • Homebrew curl?

    Homebrew curl?

    Homebrew curl installs libs in /usr/local/opt/curl/libs by default, not to mess with system-wide libcurl.

    Can we add CMake suffix for it as we did with MacPorts?

    opened by Kaned1as 2
Releases(1.4)
Owner
Giuseppe Persico
Lead Software Engineer
Giuseppe Persico
xpload is a C++ library to communicate with a calibration database via libcurl

xpload is a C++ library to communicate with a calibration database via libcurl

BNL Nuclear and Particle Physics Software Group 1 Jan 10, 2022
This is example for coding with Kotlin/Native, linking C libraries and comparison java.net.* with libcurl

KotlinNativeExample This is example for coding with Kotlin/Native, linking C libraries and comparison java.net.* with libcurl Running Running mingw64

Artem Musatenko 2 Jan 22, 2022
Data-oriented networking playground for the reliable UDP transports

NetDynamics is a data-oriented networking playground for the reliable UDP transports. The application was created for stress testing and debugging a p

Stanislav Denisov 88 Jun 20, 2022
A small data-oriented and SIMD-optimized 3D rigid body physics library.

nudge Nudge is a small data-oriented and SIMD-optimized 3D rigid body physics library. For more information, see: http://rasmusbarr.github.io/blog/dod

null 231 Jun 10, 2022
High-level networking API for real-time simulations with primitives for remote procedure call and object state replication

tnl2 - Torque Network Library version 2 tnl2 is a high-level networking API for real-time simulations with primitives for remote procedure call and o

Mark Frohnmayer 23 Apr 10, 2022
Wrapper library for the BSD sockets API with a nicer C99 interface

A wrapper library for the BSD sockets API. Why? This library trades the series of getaddrinfo, socket, connect, bind, listen, etc. functions and their

Scott Vokes 132 Jun 19, 2022
Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!

Do you have a question that doesn't require you to open an issue? Join the gitter channel. If you use uvw and you want to say thanks or support the pr

Michele Caini 1.5k Jun 24, 2022
WinINet wrapper - tiny windows HTTPS library, no dependencies.

WNetWrap A tiny, dependency-free wrapper around WinINet for developers targeting Windows only, who need a lightweight native solution. Inspired by the

hack-tramp 24 Apr 6, 2022
Wrapper for linux TCP/UDP/unix/USB socket connections

Socket Connection wrapper shared library Shared library that realize sockets connections and could transfer data-packages. Navigation Navigation Insta

Dmitry Golgovsky 7 Dec 21, 2021
Portable, single-file, protocol-agnostic TCP and UDP socket wrapper, primarily for game networking

Documentation This is a header-only library, as such most of its functional documentation is contained within the "header section" of the source code

null 62 Mar 23, 2022
C++ wrapper for librg network library

librg-cpp Description C++ wrapper for librg network library Warning: The wrapper is under heavy development and will have breaking changes still a fir

null 6 Sep 28, 2020
A universal C++20 wrapper for cross-platform sockets.

NetSockets A fast and clean, universal C++20 wrapper for cross-platform sockets. This wrapper uses ENet by lsalzman (https://github.com/lsalzman/enet)

null 3 Apr 17, 2022
curl4cpp - single header cURL wrapper for C++ around libcURL.

curl4cpp - single header cURL wrapper for C++ around libcURL.

Ferhat Geçdoğan 14 Jun 12, 2022
curl cmake module libcurl build with msvc x86

curl-msvc Infomation curl cmake module libcurl build with MSVC10.0 arch (x86 | i386) source from https://github.com/curl/curl tags: curl-7_79_1 Usage

Jason Payne 0 May 16, 2022
Repository for the Object-oriented programming course for academic year 2020/21

Object-Oriented Programming 2020/21 Repository for the Object-oriented programming course for the 2020/21 academic year. Structure exam -- tasks given

Atanas Semerdzhiev 19 Oct 21, 2021
Loop is an object oriented programming language

Loop Loop is an object oriented programming language. How do I build and run loop? Make sure, you installed the requirements for clang and make: Debia

Loop 24 Aug 9, 2021
[3DV 2021] DSP-SLAM: Object Oriented SLAM with Deep Shape Priors

DSP-SLAM Project Page | Video | Paper This repository contains code for DSP-SLAM, an object-oriented SLAM system that builds a rich and accurate joint

Jingwen Wang 295 Jun 21, 2022
FEMTIC is a 3-D magnetotelluric inversion code. FEMTIC is made by object-oriented programming with C++.

FEMTIC FEMTIC is a 3-D magnetotelluric inversion code based on the following studies. FEMTIC was made using object-oriented programming with C++. FEMT

Yoshiya Usui 13 Jun 7, 2022
Object oriented programming(with C++)

Object oriented programming(with C++) finalTestReview vector push_back() size() (for iteration) inheritance pure function(virtual) in Base class must

Kim Moon Jeong 1 Dec 22, 2021
Carts - Simple Algorithm in C++ with Object-Oriented Flavor

It's a simple algorithm implemented in C++ with intentionally heavy usages of classes, inheritance, encapsulation, and polymorphism. There is a stock

Yegor Bugayenko 4 Jan 21, 2022
Computer room reservation system(Object oriented programming)

Computer-room-reservation-system Computer room reservation system(Object oriented programming) 首先进入登录界面,可选登录身份有: 学生代表 老师 管理员 退出 每个身份都需要进行验证后,进入子菜单 学生需

life_geometry 2 Jan 1, 2022
C++ Requests: Curl for People, a spiritual port of Python Requests

C++ Requests: Curl for People Announcements The cpr project has new maintainers: Fabian Sauter and Tim Stack. TLDR C++ Requests is a simple wrapper ar

Huu Nguyen 4.7k Jul 1, 2022
A PostgreSQL extension providing an async networking interface accessible via SQL using a background worker and curl.

pg_net is a PostgreSQL extension exposing a SQL interface for async networking with a focus on scalability and UX.

Supabase 41 Jun 19, 2022
C++ Requests: Curl for People, a spiritual port of Python Requests.

C++ Requests: Curl for People Announcements Like you probably have noticed, cpr moved to a new home from https://github.com/whoshuu/cpr to https://git

null 4.7k Jun 29, 2022
Tools to measure libcurl performance delta between versions

relative Tools to measure libcurl performance delta between versions build-many This script iterates over all the curl versions listed in the top of t

curl 11 Aug 30, 2021
xpload is a C++ library to communicate with a calibration database via libcurl

xpload is a C++ library to communicate with a calibration database via libcurl

BNL Nuclear and Particle Physics Software Group 1 Jan 10, 2022
Lua HTTP async client using libcurl (supports multi requests in parallel)

lua-async-http lua-async-http rock, is a new lua rock written in C and based on libcurl. It allow us to make multiple http/https (with client certific

International Business Machines 4 Jun 11, 2022
This is example for coding with Kotlin/Native, linking C libraries and comparison java.net.* with libcurl

KotlinNativeExample This is example for coding with Kotlin/Native, linking C libraries and comparison java.net.* with libcurl Running Running mingw64

Artem Musatenko 2 Jan 22, 2022
Object Based Generic Perception Object Model

This model is a highly parameterizable generic perception sensor and tracking model. It can be parameterized as a Lidar or a Radar. The model is based on object lists and all modeling is performed on object level.

TU Darmstadt - FZD 5 Jun 11, 2022