Important: Please read the Qt Code of Conduct -

Use Libmodbus library

  • Goodmorning to all,
    I've build a custom OS image and sdk generated with yocto poky-morty so that I could cross compile my applications for a Raspberrypi3.
    Qt version is 5.7.1. I've done the folling steps:

    • Yocto generated the following modbus library files:
      saved in the following path of my host sytem:

    • I've downloaded the following modbus qt wrapper project:

    • When I try to compile the project I get the error:
      modbus.h: No such file or directory

    • I tried to include the external library, giving the path for reported above but I get the same error.

    Can you help me?
    Thank you.

  • Lifetime Qt Champion


    Why not use the QtSerialBus module ?

  • Hello StGaist,
    thank you again for your answer. I didn't know of this library, and it looks simpler to use than the qt wrappeer that I found, I'll definitely pass to this.

    Just for information for those ones who use Yocto, the problem was that I had to add the following for seeing modbus.h:
    INCLUDEPATH += $$PWD/../../../../opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/modbus
    DEPENDPATH += $$PWD/../../../../opt/poky/sdk-2.2.2/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/usr/include/modbus
    After that I had the following problem:
    cannot find /lib/arm-linux-gnueabihf/
    and found solution here:

    Thank you again StGaist :)

Log in to reply