azadkuh / qhttp

a light-weight and asynchronous HTTP library (both server & client) in Qt5 and c++14
MIT License
483 stars 158 forks source link

Error on compiling #21

Open williamkibira opened 8 years ago

williamkibira commented 8 years ago

Hello, i encountered this issue when i was trying to compile qhttp on my machine .

private/httpwriter.hxx:87:55: note: qhttp::details::HttpWriter<TBase, TImpl>::writeHeaders(bool) [with TBase = qhttp::details::HttpResponseBase; TImpl = qhttp::server::QHttpResponsePrivate]::__lambda0 TBase::iheaders.forEach([this](const auto& cit) { ^ private/httpwriter.hxx:87:55: note: candidate expects 0 arguments, 1 provided make[1]: * [../tmp/unix/qhttp/qhttpserverresponse.o] Error 1 make[1]: * Waiting for unfinished jobs.... make[1]: * [../tmp/unix/qhttp/qhttpserverconnection.o] Error 1 make[1]: Leaving directory `/home/william/Desktop/BUS_BUDDY_DESKTOP/qhttp/src' make: * [sub-src-make_first] Error 2

Any help in resolving this issue would be greatly appreciated .

azadkuh commented 8 years ago

would you please give more info about the compiler version and your os?

williamkibira commented 8 years ago

The version of QMake is

QMake version 3.0 Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

I am using linux lite 2.4 64 bit

On Mon, Sep 5, 2016 at 11:41 AM, amir zamani notifications@github.com wrote:

would you please give more info about the compiler version and your os?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/azadkuh/qhttp/issues/21#issuecomment-244691057, or mute the thread https://github.com/notifications/unsubscribe-auth/ACExC4gfZwLjMwUle0Y77Lda-JG-sRcMks5qm9WlgaJpZM4J0vDx .

azadkuh commented 8 years ago

@williamkibira

please have a look at: asciicast

under Ubuntu and ArchLinux, I have tried g++ 5.4+ / g++ 6.x without any problem. please also make sure that you are using a recent c++ compiler with full c++14 support.

azadkuh commented 8 years ago

and under Ubuntu 14.04 and g++ 5.3 asciicast

williamkibira commented 8 years ago

OK , let me update my compiler to see if something change

On Mon, Sep 5, 2016 at 6:18 PM, amir zamani notifications@github.com wrote:

and under Ubuntu 14.04 and g++ 5.3 [image: asciicast] https://asciinema.org/a/49652

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/azadkuh/qhttp/issues/21#issuecomment-244770012, or mute the thread https://github.com/notifications/unsubscribe-auth/ACExCzNtduJHx26tl8ZOJZ8JFYrPWMvPks5qnDLWgaJpZM4J0vDx .

williamkibira commented 8 years ago

I have updated my compiler to 6.2 and a new error has occurred instead .

r::HttpRequestParser() [with TImpl = qhttp::server::QHttpConnectionPrivate]’ private/qhttpserverconnection_private.hpp:33:66: required from here private/httpparser.hxx:74:18: error: invalid use of ‘auto’ return me(p)->body(p, at, length); ^ private/httpparser.hxx: In instantiation of ‘static int qhttp::details::HttpParser::onMessageComplete(httpparser) [with TImpl = qhttp::server::QHttpConnectionPrivate; http_parser = http_parser]’: private/httpparser.hxx:38:45: required from ‘qhttp::details::HttpParser::HttpParser(http_parser_type) [with TImpl = qhttp::server::QHttpConnectionPrivate]’ private/httpparser.hxx:106:57: required from ‘qhttp::details::HttpRequestParser::HttpRequestParser() [with TImpl = qhttp::server::QHttpConnectionPrivate]’ private/qhttpserverconnectionprivate.hpp:33:66: required from here private/httpparser.hxx:78:18: error: invalid use of ‘auto’ return me(p)->messageComplete(p); ^ make[1]: ** [../tmp/unix/qhttp/qhttpserverconnection.o] Error 1 make[1]: * Waiting for unfinished jobs.... make[1]: Leaving directory `/home/william/Desktop/BUS_BUDDY_DESKTOP/qhttp/src' make: * [sub-src-make_first] Error 2

On Mon, Sep 5, 2016 at 6:21 PM, William Kibira williamkibira@gmail.com wrote:

OK , let me update my compiler to see if something change

On Mon, Sep 5, 2016 at 6:18 PM, amir zamani notifications@github.com wrote:

and under Ubuntu 14.04 and g++ 5.3 [image: asciicast] https://asciinema.org/a/49652

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/azadkuh/qhttp/issues/21#issuecomment-244770012, or mute the thread https://github.com/notifications/unsubscribe-auth/ACExCzNtduJHx26tl8ZOJZ8JFYrPWMvPks5qnDLWgaJpZM4J0vDx .

azadkuh commented 8 years ago

it simply says that the toolchain has not configured to compile c++11/14

please make sure CONFIG += c++11 c++14 is enabled in commondir.pri and you can compile a trivial code like:

// shall return QByteArray
auto foo() {
   return QString("unicode").toUtf8();
}
williamkibira commented 8 years ago

specifying common dirs

DEFINES *= QHTTP_HAS_CLIENT

Qt5.5.1 on OSX needs both c++11 and c++14!! the c++14 is not enough

CONFIG += c++11 c++14

unix { TEMPDIR = $$PRJDIR/tmp/unix/$$TARGET macx:TEMPDIR = $$PRJDIR/tmp/osx/$$TARGET }

win32 { warning("Windows port of this library has not been tested nor profiled.") TEMPDIR = $$PRJDIR/tmp/win32/$$TARGET DEFINES += _WINDOWS WIN32_LEAN_AND_MEAN NOMINMAX }

DESTDIR = $$PRJDIR/xbin MOC_DIR = $$TEMPDIR OBJECTS_DIR = $$TEMPDIR RCC_DIR = $$TEMPDIR UI_DIR = $$TEMPDIR/Ui LIBS += -L$$PRJDIR/xbin

INCLUDEPATH += . $$PRJDIR/src $$PRJDIR/3rdparty

It is enabled

On Mon, Sep 5, 2016 at 7:50 PM, amir zamani notifications@github.com wrote:

it simply says that the toolchain has not configured to compile c++11/14

please make sure CONFIG += c++11 c++14 is enabled in commondir.pri and you can compile a trivial code like:

// shall return QByteArrayauto foo() { return QString("unicode").toUtf8(); }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/azadkuh/qhttp/issues/21#issuecomment-244785090, or mute the thread https://github.com/notifications/unsubscribe-auth/ACExC_Fci43gVeOgEL2CMUvzNt_XXoUiks5qnEg4gaJpZM4J0vDx .

williamkibira commented 8 years ago

Just tested this

include

int main(){ auto value = 4; std::cout << value <<std::endl;

return 0; } ~

and it compiled and ran.

On Mon, Sep 5, 2016 at 7:56 PM, William Kibira williamkibira@gmail.com wrote:

specifying common dirs

DEFINES *= QHTTP_HAS_CLIENT

Qt5.5.1 on OSX needs both c++11 and c++14!! the c++14 is not enough

CONFIG += c++11 c++14

unix { TEMPDIR = $$PRJDIR/tmp/unix/$$TARGET macx:TEMPDIR = $$PRJDIR/tmp/osx/$$TARGET }

win32 { warning("Windows port of this library has not been tested nor profiled.") TEMPDIR = $$PRJDIR/tmp/win32/$$TARGET DEFINES += _WINDOWS WIN32_LEAN_AND_MEAN NOMINMAX }

DESTDIR = $$PRJDIR/xbin MOC_DIR = $$TEMPDIR OBJECTS_DIR = $$TEMPDIR RCC_DIR = $$TEMPDIR UI_DIR = $$TEMPDIR/Ui LIBS += -L$$PRJDIR/xbin

INCLUDEPATH += . $$PRJDIR/src $$PRJDIR/3rdparty

It is enabled

On Mon, Sep 5, 2016 at 7:50 PM, amir zamani notifications@github.com wrote:

it simply says that the toolchain has not configured to compile c++11/14

please make sure CONFIG += c++11 c++14 is enabled in commondir.pri and you can compile a trivial code like:

// shall return QByteArrayauto foo() { return QString("unicode").toUtf8(); }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/azadkuh/qhttp/issues/21#issuecomment-244785090, or mute the thread https://github.com/notifications/unsubscribe-auth/ACExC_Fci43gVeOgEL2CMUvzNt_XXoUiks5qnEg4gaJpZM4J0vDx .