Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Adding github web URL of libraries to Qt Creator



  • Hi,
    I have been trying to use cURLpp with Qt, but I cannot even find a way to add the library to my project.

    I need to add curl and curlpp. I tried adding an external library to my Qt project, but they are not downloaded as a .lib file, so Qt seems unable to import them. They are made of headers and source files, so I want to know how to easily incorporate them.

    I added the web urls for both these libraries in my sourcetree repository. I have the library folders outside of the qt project this way, but I dont think there is any other option in this case.

    b31e5a03-db0f-494c-8cd7-1890a3ece5ee-image.png

    Then, I tried setting up my .pro file and filepaths, but I have been unsuccessful after hours of work. This is what I have.

    CONFIG += c++11
    
    INCLUDEPATH += curlpp \
    curl \
    curl/include/curl \
    curl/src/curl
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp
    
    HEADERS += \ 
        mainwindow.h
    
    FORMS += \
        mainwindow.ui
    

    Since curlpp is a C++ wrapper for curl, it has some dependencies and tries to include curl at some point. I get an error (no matter what I try) when curlpp tries to include the curl header, in the cURLpp.hpp header.

    22192aa6-ef31-4968-a6b6-dd41b5073c68-image.png

    Is there a more simple way to include libraries, or is there something I can correct to let the 2 libs talk to eachother?
    thanks!


  • Lifetime Qt Champion

    Hi,

    Did you just clone the curl sources ? If so the you have to build it before you can use it.