Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt CAN bus

Qt CAN bus

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 71 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Groundbounce
    wrote last edited by
    #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.

    jsulmJ 1 Reply Last reply
    0
    • G Groundbounce

      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.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote last edited by
      #2

      @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?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • G Offline
        G Offline
        Groundbounce
        wrote last edited by
        #3

        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?

        Pl45m4P 1 Reply Last reply
        0
        • G Groundbounce

          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?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote last edited by Pl45m4
          #4

          @Groundbounce

          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 the project(.....).
          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.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          2
          • G Offline
            G Offline
            Groundbounce
            wrote last edited by
            #5

            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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved