0

I am using cURL for MinGW64 from http://curl.haxx.se/download.html v7.34.0 with the cURL wrappers from https://github.com/JosephP91/curlcpp and Qt 5.2.1 as soon as I load the libraries in .pro, wild syntax related error blossom by the truckloads https://i.stack.imgur.com/Aj9KQ.png I really suspect it is version related, but I do not know the solution.

section of code it borks on example:

template<class T> class CurlError : public exception {
public:
    CurlError(const string error, const T code) : error(error), code(code) {}
    ~CurlError() throw() {};
    pair<string,T> what() noexcept;
private:
    string error;
    T code;
};

error output:

C:\Users\Brad2\Documents\GitHub\curlcpp\include\CurlError.h:25: error: expected ';' at end of member declaration
     pair<string,T> what() noexcept;
                         ^
brad
  • 870
  • 2
  • 13
  • 38
  • Enabled C++11 `-std=c++11` – Brandon May 28 '14 at 23:05
  • @Brandon How do I enable c++11 support in Qt5? – brad May 28 '14 at 23:55
  • Is that a MinGW64 thing? Do I recompile MinGW with c++11 support? – brad May 29 '14 at 00:09
  • I found this -> http://stackoverflow.com/questions/19425482/windows-c-compiler-with-full-c11-support-should-work-with-qt How do I check to see if my build is using std::thread ?? – brad May 29 '14 at 00:17
  • I did try to use qmake from the msvc libraries that are included with the default installation of Qt5 to see if they had c++11 but received an unrelated error http://i.imgur.com/yTEJzU1.png – brad May 29 '14 at 00:36
  • Just in case there is still confusion, the qmake equivalent of the `-std=c++11` cli option is by adding the two lines to your .pro file: `QMAKE_CXXFLAGS = -std=c++11` and `QMAKE_LFLAGS = -std=c++11`. – Niko Aug 21 '14 at 21:07

2 Answers2

1

The following is from my .pro file in qt. You'll need to substitute directories as needed ($$PWD is the qmake variable for the root directory of your project, and I have curlcpp as a git-submodule in a folder called thirdparty)

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

INCLUDEPATH     += "$$PWD/thirdparty/curlcpp/include/"
LIBS            += -L"$$PWD/thirdparty/curlcpp/build/src/" \
                    -lcurlcpp \
                    -lcurl
Niko
  • 4,158
  • 9
  • 46
  • 85
0

I was never able to get this fixed. I went with QNetworkAccessManager instead of curl

brad
  • 870
  • 2
  • 13
  • 38