JosephP91 / curlcpp

An object oriented C++ wrapper for CURL (libcurl)
https://josephp91.github.io/curlcpp
MIT License
630 stars 174 forks source link

qt c++ error: curl/curl.h: No such file or directory #4

Closed tunage closed 10 years ago

tunage commented 10 years ago

I downloaded the libcURL source code and imported the headers and source into my .pro file and it seems to find all the libraries except for the main one.

dies on:

include <curl/curl.h>

.pro file contains:

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = RESTtest TEMPLATE = app

SOURCES += main.cpp\ mainwindow.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlMulti.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlHeader.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlVersion.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlEasy.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlShare.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlMessage.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlHttpPost.cpp

HEADERS += mainwindow.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlEasy.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlInterface.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlMulti.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlPair.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlVersion.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlHttpPost.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlHeader.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlShare.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlMessage.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlError.h

FORMS += mainwindow.ui

INCLUDEPATH += "../../../../../Users/Brad2/Documents/GitHub/curlcpp/include" INCLUDEPATH += "../../../../../Users/Brad2/Documents/GitHub/curlcpp/src"

JosephP91 commented 10 years ago

Hi, with the "main one" do you mean the libcurl library? If so, you have to install it. curl/curl.h is the header file of libcurl library.

Let me know!

Giuseppe Persico Software developer University of Naples "Parthenope" giuseppe.persico91@gmail.com

Il giorno 28/mag/2014, alle ore 16:03, tunage notifications@github.com ha scritto:

I downloaded the libcURL source code and imported the headers and source into my .pro file and it seems to find all the libraries except for the main one.

dies on:

include

.pro file contains:

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = RESTtest TEMPLATE = app

SOURCES += main.cpp\ mainwindow.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlMulti.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlHeader.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlVersion.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlEasy.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlShare.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlMessage.cpp \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/src/CurlHttpPost.cpp

HEADERS += mainwindow.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlEasy.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlInterface.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlMulti.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlPair.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlVersion.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlHttpPost.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlHeader.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlShare.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlMessage.h \ ../../../../../Users/Brad2/Documents/GitHub/curlcpp/include/CurlError.h

FORMS += mainwindow.ui

INCLUDEPATH += "../../../../../Users/Brad2/Documents/GitHub/curlcpp/include" INCLUDEPATH += "../../../../../Users/Brad2/Documents/GitHub/curlcpp/src"

— Reply to this email directly or view it on GitHub.

tunage commented 10 years ago

The issue appears a lot deeper than that. http://stackoverflow.com/questions/23922917/wild-errors-after-loading-curl-libraries-into-qt5?noredirect=1#comment36843436_23922917 This is a post I have running. getting the curl core to work with Qt does not appear to be that easy I am afraid. :(

JosephP91 commented 10 years ago

Yes, it should be the main libcur library. Have tou tried to install it?

Giuseppe Persico Software developer University of Naples "Parthenope" giuseppe.persico91@gmail.com

Il giorno 29/mag/2014, alle ore 03:22, tunage notifications@github.com ha scritto:

The issue appears a lot deeper than that. http://stackoverflow.com/questions/23922917/wild-errors-after-loading-curl-libraries-into-qt5?noredirect=1#comment36843436_23922917 This is a post I have running. getting the curl core to work with Qt does not appear to be that easy I am afraid. :(

— Reply to this email directly or view it on GitHub.

tunage commented 10 years ago

I include the source and headers in the .pro can can find the libraries just fine, but because it appears I am not compiled with std::thread support, I blow errors everywhere. I am trying to figure out how to do that now.

JosephP91 commented 10 years ago

If you have problems with std::thread, make sure that you are compiling the sources with the option -std=c++11 (or -std=c++0x, I don't remember), because std::thread is a new feature of C++! I will close this issue. Thank you!

niko-dunixi commented 10 years ago

@tunage Because you are using qmake to build your project you need the equivalent of the cli option -std=c++11 which are the two following lines:

QMAKE_CXXFLAGS = -std=c++11
QMAKE_LFLAGS = -std=c++11

(I don't know if their placement in your .pro file is important, but I have mine at the top before everything else.)

Additionally, instead of specifying each header and cpp file; you can simplify your .pro file by using:

INCLUDEPATH     += "$$PWD/thirdparty/curlcpp/include/"
LIBS            += -L"$$PWD/thirdparty/curlcpp/build/src/" \
                    -lcurlcpp \
                    -lcurl

(Obviously you need to subsitute the directories with your own. $$PWD is the root of my project and I'm using curlcpp as a git-submodule int a folder called thirdparty)