Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on compiling #21

Open
williamkibira opened this issue Sep 5, 2016 · 9 comments
Open

Error on compiling #21

williamkibira opened this issue Sep 5, 2016 · 9 comments

Comments

@williamkibira
Copy link

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
Copy link
Owner

azadkuh commented Sep 5, 2016

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

@williamkibira
Copy link
Author

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 [email protected]
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
#21 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACExC4gfZwLjMwUle0Y77Lda-JG-sRcMks5qm9WlgaJpZM4J0vDx
.

@azadkuh
Copy link
Owner

azadkuh commented Sep 5, 2016

@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
Copy link
Owner

azadkuh commented Sep 5, 2016

and under Ubuntu 14.04 and g++ 5.3
asciicast

@williamkibira
Copy link
Author

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

On Mon, Sep 5, 2016 at 6:18 PM, amir zamani [email protected]
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
#21 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACExCzNtduJHx26tl8ZOJZ8JFYrPWMvPks5qnDLWgaJpZM4J0vDx
.

@williamkibira
Copy link
Author

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(http_parser_) [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/qhttpserverconnection_private.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 [email protected]
wrote:

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

On Mon, Sep 5, 2016 at 6:18 PM, amir zamani [email protected]
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
#21 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACExCzNtduJHx26tl8ZOJZ8JFYrPWMvPks5qnDLWgaJpZM4J0vDx
.

@azadkuh
Copy link
Owner

azadkuh commented Sep 5, 2016

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
Copy link
Author

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 [email protected]
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
#21 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACExC_Fci43gVeOgEL2CMUvzNt_XXoUiks5qnEg4gaJpZM4J0vDx
.

@williamkibira
Copy link
Author

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 [email protected]
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 [email protected]
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
#21 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACExC_Fci43gVeOgEL2CMUvzNt_XXoUiks5qnEg4gaJpZM4J0vDx
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants