Skip to content

Instantly share code, notes, and snippets.

@awesomebytes
Last active February 1, 2023 09:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awesomebytes/ed90785324757b03c8f01e3ffa36d436 to your computer and use it in GitHub Desktop.
Save awesomebytes/ed90785324757b03c8f01e3ffa36d436 to your computer and use it in GitHub Desktop.
Use qt serialbus in ubuntu 18.04 with qt 5.9

Using the Qt serialbus (to access a CAN bus) in Ubuntu 18.04

I was trying to compile a Qt project that uses the Qt serialbus module and it was not configuring when using qmake, the error was: Unknown module(s) in QT: serialbus. So I needed to build qtserialbus myself.

While trying to build it I ran into: fatal error: private/qobject_p.h: No such file or directory.

# Overkill: get all qt-stuff
sudo apt install qml-module-qt-labs-folderlistmodel qml-module-qtquick-extras qml-module-qtquick-controls2 qt5-default libqt5quickcontrols2-5 qtquickcontrols2-5-dev qtcreator qtcreator-doc libqt5serialport5-dev build-essential qml-module-qt3d qt3d5-dev qtdeclarative5-dev qtconnectivity5-dev qtmultimedia5-dev
# To get rid of the private/qobject_p.h error
sudo apt-get install qtbase5-private-dev
# Build and install qtserialbus
git clone git://code.qt.io/qt/qtserialbus.git
cd qtserialbus
git checkout 5.9.8
qmake
make -j6
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment