Reputation: 2166
It appears that libwebsocket is the only library that does not come with Qt, so I think I need to compile it and install it in my QT folder so I can use with other things.
I tried to compile libwebsocket and I got this error:
qwebsocket_p.h:65:10: fatal error: private/qobject_p.h: No such file or directory
#include <private/qobject_p.h>
I believe this is because the QT in my system is old. I have a QT installation in my home folder. How should I pass it to websocket?
If it were with cmake I'd have an idea, but I've heard here https://stackoverflow.com/a/49108604/10116440 that you cannot pass qt folder to qmake. Is there a way to pass to make?
I also tried doing this in cmake:
find_package(Qt5WebSockets REQUIRED)
find_package(Qt5 COMPONENTS Core Qml Quick Svg)
this way I can do cmake -DQt5_DIR=/home/lz/Qt5.11.2 .
to set the Qt5 variable for everything except Qt5WebSockets
, but the project fails to include <QWebSocket>
anyway. If someone knows how to solve this, it'd also be good
Upvotes: 1
Views: 2073
Reputation: 15091
private/qobject_p.h: No such file or directory
That means that the directory containing qobject_p.h
was not added to the Include paths list. Make sure that your .pro has QT += core-private
string.
I have a QT installation in my home folder. How should I pass it to websocket?
It should be enough to put the file named qt.conf
to the directory containing qmake.exe
:
qt.conf
[Paths]
Prefix = <qt root>
Upvotes: 2