How to compile Qt5Websockets and install it on my Qt folder installation?
-
I forgot to mention that my project is strictly cmake, there are no pro files
@lucaszanella
What version of Qt? and on what platform? -
@lucaszanella
What version of Qt? and on what platform?@Ratzz I just installed Qt5.11.2 on my home folder on Ubuntu and I'm doing
cmake -DQt5_DIR=/home/lz/Qt5.11.2 .
to force cmake to use it. But since it doesn't come with websockets I'm having problems
-
@Ratzz I just installed Qt5.11.2 on my home folder on Ubuntu and I'm doing
cmake -DQt5_DIR=/home/lz/Qt5.11.2 .
to force cmake to use it. But since it doesn't come with websockets I'm having problems
@lucaszanella
Can you trysudo apt-get install libqt5websockets5-dev
or try to build it https://github.com/qt/qtwebsockets -
@lucaszanella
Can you trysudo apt-get install libqt5websockets5-dev
or try to build it https://github.com/qt/qtwebsockets@Ratzz said in How to compile Qt5Websockets and install it on my Qt folder installation?:
Can you try sudo apt-get install libqt5websockets5-dev
He uses custom Qt installation, installing Qt packages from Ubuntu will not help
-
@lucaszanella
Can you trysudo apt-get install libqt5websockets5-dev
or try to build it https://github.com/qt/qtwebsockets@Ratzz said in How to compile Qt5Websockets and install it on my Qt folder installation?:
or try to build it https://github.com/qt/qtwebsockets
@jsulm may be he should use this?
-
@Ratzz said in How to compile Qt5Websockets and install it on my Qt folder installation?:
or try to build it https://github.com/qt/qtwebsockets
@jsulm may be he should use this?
@Ratzz I tried to build from source, but I think since my QT on computer (not the on on the home folder) is old, I have the error I mentioned in my first post. So I think I have to find a way to compile the websockets library using the QT on the home folder
-
@Ratzz I tried to build from source, but I think since my QT on computer (not the on on the home folder) is old, I have the error I mentioned in my first post. So I think I have to find a way to compile the websockets library using the QT on the home folder
@lucaszanella
How many versions of Qt is installed in system?
What is that old Qt mean? -
@lucaszanella
How many versions of Qt is installed in system?
What is that old Qt mean?@Ratzz I have Qt 5.12.1 installed on my home folder, and the Qt from Ubuntu instaled on the system, which is 5.3. I want to compile libwebsockets using the Qt 5.12.1
-
@Ratzz I have Qt 5.12.1 installed on my home folder, and the Qt from Ubuntu instaled on the system, which is 5.3. I want to compile libwebsockets using the Qt 5.12.1
@lucaszanella so how did you install Qt 5.12.1?
And how did you check that you don't have websockets?
I really doubt that websockets are missing, since they will be installed by only and offline installer always.
The only exception is the distributions package manager, where you may be able to install them separate.
Regards
-
@Ratzz I have Qt 5.12.1 installed on my home folder, and the Qt from Ubuntu instaled on the system, which is 5.3. I want to compile libwebsockets using the Qt 5.12.1
regarding the question:
Is there a way to pass to make?
Each Qt version has it's own qmake, so by choosing qmake (with full path) you choose the Qt version you wanne use.
Regards
-
@lucaszanella so how did you install Qt 5.12.1?
And how did you check that you don't have websockets?
I really doubt that websockets are missing, since they will be installed by only and offline installer always.
The only exception is the distributions package manager, where you may be able to install them separate.
Regards
@aha_1980 because the project im compiling compiles lots of files that use Qt, but the only problem happens on QtWebsocket. Strangely enough, /home/lz/Qt5.11.2/5.11.2/gcc_64/lib do indeed contain libwebsockets.
Does that output mean anything to you?
[ 30%] Building CXX object react-native-desktop-orwell/ReactQt/runtime/src/CMakeFiles/react-native.dir/websocketmodule.cpp.o cd /home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src && /usr/bin/c++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -Dreact_native_EXPORTS -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/react-native_autogen/include -I/home/lz/orwell/react-native-desktop-orwell/./React/Layout -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/Base64_live555/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/md5/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/JRTPLIB/src -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/myRtspClient/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/JTHREAD/src -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../.. -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/jrtplib/src -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtWidgets -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtGui -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtCore -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/./mkspecs/linux-g++ -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtMultimedia -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtNetwork -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtMultimediaWidgets -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtQml -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtQuick -std=c++11 -fPIC -fPIC -std=gnu++11 -o CMakeFiles/react-native.dir/websocketmodule.cpp.o -c /home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/websocketmodule.cpp /home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/websocketmodule.cpp:12:10: fatal error: QWebSocket: No such file or directory #include <QWebSocket>
-
@aha_1980 because the project im compiling compiles lots of files that use Qt, but the only problem happens on QtWebsocket. Strangely enough, /home/lz/Qt5.11.2/5.11.2/gcc_64/lib do indeed contain libwebsockets.
Does that output mean anything to you?
[ 30%] Building CXX object react-native-desktop-orwell/ReactQt/runtime/src/CMakeFiles/react-native.dir/websocketmodule.cpp.o cd /home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src && /usr/bin/c++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -Dreact_native_EXPORTS -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/react-native_autogen/include -I/home/lz/orwell/react-native-desktop-orwell/./React/Layout -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/Base64_live555/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/md5/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/JRTPLIB/src -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/myRtspClient/include -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../../myRtspClient/third_party/JTHREAD/src -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/../../../.. -I/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/jrtplib/src -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtWidgets -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtGui -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtCore -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/./mkspecs/linux-g++ -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtMultimedia -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtNetwork -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtMultimediaWidgets -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtQml -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtQuick -std=c++11 -fPIC -fPIC -std=gnu++11 -o CMakeFiles/react-native.dir/websocketmodule.cpp.o -c /home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/websocketmodule.cpp /home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/websocketmodule.cpp:12:10: fatal error: QWebSocket: No such file or directory #include <QWebSocket>
In qmake, you would have to add
QT += websockets
to your .pro file. I really don't know how the CMake equivalent is.https://forum.qt.io/topic/60975/what-do-i-have-to-add-for-the-qt-websockets-module-in-cmake already discusses this topic, but has not been marked as SOLVED. Therefore I don't know if the solution has been found.