woodenshark / Lightpack

Lightpack and Prismatik open repository (For support use support@lightpack.tv)
https://lightpack.tv/
GNU General Public License v3.0
203 stars 243 forks source link

Compile error ‘QDataStream ds’ has initializer but incomplete type #83

Closed palandlom closed 5 years ago

palandlom commented 5 years ago

OS: ubuntu 18.04.01 Install packages: sudo apt-get install qt5-default libqt5serialport5-dev build-essential libgtk2.0-dev libusb-1.0-0-dev libnotify-dev libudev-dev libappindicator-dev git ... get the error during compilation:

singleapplication/src/qtlocalpeer.cpp
qtsingleapplication/src/qtlocalpeer.cpp: In member function ‘bool QtLocalPeer::sendMessage(const QString&, int)’:
qtsingleapplication/src/qtlocalpeer.cpp:160:19: error: variable ‘QDataStream ds’ has initializer but incomplete type
     QDataStream ds(&socket);
                   ^
qtsingleapplication/src/qtlocalpeer.cpp: In member function ‘void QtLocalPeer::receiveConnection()’:
qtsingleapplication/src/qtlocalpeer.cpp:180:26: error: variable ‘QDataStream ds’ has initializer but incomplete type
     QDataStream ds(socket);
                          ^
Makefile:1589: recipe for target 'stuff/qtlocalpeer.o' failed
make[1]: *** [stuff/qtlocalpeer.o] Error 1
make[1]: Leaving directory '/home/user/Downloads/Lightpack-master/Software/src'
Makefile:132: recipe for target 'sub-src-make_first-ordered' failed
make: *** [sub-src-make_first-ordered] Error 2

Is it the way to fix it?

epakai commented 5 years ago
diff --git a/Software/src/qtsingleapplication/src/qtlocalpeer.cpp b/Software/src/qtsingleapplication/src/qtlocalpeer.cpp
index 332b064..c7ce527 100644
--- a/Software/src/qtsingleapplication/src/qtlocalpeer.cpp
+++ b/Software/src/qtsingleapplication/src/qtlocalpeer.cpp
@@ -41,6 +41,7 @@

 #include "qtlocalpeer.h"
 #include <QCoreApplication>
+#include <QDataStream>
 #include <QTime>

 #if defined(Q_OS_WIN)

Just need to add QDataStream header as above to qtlocalpeer.cpp.

palandlom commented 5 years ago

Yes it helps - thanks