Qt CAN bus
-
Well, I am clueless as I am starting, but any attempt to include any CAN bus header file gets me a file not found error.
I have Qt Creator 16.0.1.
-
Well, I am clueless as I am starting, but any attempt to include any CAN bus header file gets me a file not found error.
I have Qt Creator 16.0.1.
@Groundbounce As shown here you have to adjust your pro or CMakeLists.txt files: https://doc.qt.io/qt-6/qcanbus.html
Did you do that? -
Ah yes I had tried that, so this produces:
error: Cannot specify link libraries for target "mytarget" which is not built by this project.OK, so I get it I have to put something in the place of "mytarget" but what? the URI does not work. I tried to app name and this seems to keep it happy bust still it cannot find the header files.
Does this code in the cmake file need to go anywhere in particular?
-
Ah yes I had tried that, so this produces:
error: Cannot specify link libraries for target "mytarget" which is not built by this project.OK, so I get it I have to put something in the place of "mytarget" but what? the URI does not work. I tried to app name and this seems to keep it happy bust still it cannot find the header files.
Does this code in the cmake file need to go anywhere in particular?
Knowing CMake would help here :)
Post what you did with your CMakeLists down below, otherwise one can only guess what you did wrong.OK, so I get it I have to put something in the place of "mytarget" but what? the URI does not work
I just read this...
Yes,mytarget
is a placeholder for, big surprise, the name of the CMake target that you are building.
You can find the target name where you start theproject(.....)
.
It's always just a name, never a path or file or something.@Groundbounce said in Qt CAN bus:
it cannot find the header files.
What have you tried?
#include <QCanBus>
#include <SerialBus/QCanBus>
#include "SerialBus/QCanBus.h"
(could also be "QtSerialBus")None of these work?!
BTW: How did you install Qt? Did you actually download and install the
SerialBus
module when using the online installer, for example?!
Check the Maintainance Tool or your local directory if the files are actually there. -
Sorry, forum only lets me post every 10 minutes and had to go. Putting the cmake code at the bottom of the file stopped the errors.
Knowing cmake would help? knowing everything would help, I'm getting there.