11

I'm trying to run a simple client example using QTWebsockets using Qt Creator, already add the

QT       += websockets

But it throws this when i run build or qmake

:-1: error: Unknown module(s) in QT: websockets

I tried

QT       += core websockets

Then realized that since installed Qt Creator from the repositories it wasn't up to date, so I reinstalled it from the Qt website but the problem persisted, I then ran pkg-config --modversion QtCore and it returns 4.8.6, thing is, in the QT version tab of qt creator it shows 5.4.1 to GCC compiler which is the compiler I’m using, in /opt/Qt/5.4/gcc_64/lib there is the QT5WebSockets module even in the help tab are listed the QT5 modules but I can't use them.

Tried with SerialPort and it didn't work, tried with Opengl and it worked which means is a version problem but I can't seem to find how to solve.

  • For qt version which qt creator sees it is important what is listed in Options -> Build & Run -> Qt versions, do you have only 5.4.1 there? Also could you please add to your post the exact text of error? – demonplus Apr 29 '15 at 04:24
  • In the auto-detect part it only sees 5.4.1 for GCC and Android armv7, and in manual it shows _Qt 5.2.1 in PATH (qt5)_ – Christian Raul Hidalgo Pino Apr 29 '15 at 14:48
  • Does this answer your question? [Project ERROR: Unknown module(s) in QT: webkitwidgets](https://stackoverflow.com/questions/18699403/project-error-unknown-modules-in-qt-webkitwidgets) – iammilind Feb 10 '22 at 11:51

3 Answers3

20
sudo apt-get install libqt5websockets5-dev
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
sonichy
  • 1,370
  • 2
  • 14
  • 17
1

I solved it, the problem was that I just opened the project I made with qt4, when I tried to build it in the freshly installed qt creator the .pro.user file kept pointing to all qt4.

Solution, create a new project and add the source from the first, or change all the references from qt4 to qt5.

0
sudo zypper install libqt5-qtwebsockets-devel
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
K.K.
  • 1