Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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