Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT_HOST_PATH is required to *use* Qt (6.9.1) on RPi
Forum Updated to NodeBB v4.3 + New Features

QT_HOST_PATH is required to *use* Qt (6.9.1) on RPi

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 62 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.
  • S Offline
    S Offline
    SwimRideRunCode
    wrote last edited by
    #1

    I won't go into the pain and suffering of how I got Qt6.9.1 cross-compiled onto my RPi4 unless asked, but I eventually did it!
    Now, when I try to load my project's CMake file in CLion (running on the RPi) I get:

    CMake error at <my pi qt path>/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake.278 (message):
        To use a cross-compiled Qt, please set the QT_HOST_PATH cache variable to
        the location of your Qt installation.
    

    "To use a cross-compiled Qt"!
    There's nothing in https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi about copying the host Qt installation across to the RPi.

    I tried setting QT_HOST_PATH to my RPi Qt location (the RPi is now the host after all), and I even started to copy the host Qt files across as they were asked for (in the hope that they won't actually be used) but I could see that this was going to go on forever so gave up.

    What do I need to do in the process to prevent the Qt CMake infrastructure asking for host Qt files?

    Thanks in advance.

    jsulmJ 1 Reply Last reply
    0
    • S SwimRideRunCode

      I won't go into the pain and suffering of how I got Qt6.9.1 cross-compiled onto my RPi4 unless asked, but I eventually did it!
      Now, when I try to load my project's CMake file in CLion (running on the RPi) I get:

      CMake error at <my pi qt path>/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake.278 (message):
          To use a cross-compiled Qt, please set the QT_HOST_PATH cache variable to
          the location of your Qt installation.
      

      "To use a cross-compiled Qt"!
      There's nothing in https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi about copying the host Qt installation across to the RPi.

      I tried setting QT_HOST_PATH to my RPi Qt location (the RPi is now the host after all), and I even started to copy the host Qt files across as they were asked for (in the hope that they won't actually be used) but I could see that this was going to go on forever so gave up.

      What do I need to do in the process to prevent the Qt CMake infrastructure asking for host Qt files?

      Thanks in advance.

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

      @SwimRideRunCode said in QT_HOST_PATH is required to *use* Qt (6.9.1) on RPi:

      running on the RPi

      So, you want to use your cross-compiled Qt to build directly on Raspberry PI? Why? Cross compilation means you build on a host machine for another target machine. If you want to build directly on Raspberry PI you should build Qt there.

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

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SwimRideRunCode
        wrote last edited by SwimRideRunCode
        #3

        Sadly, I can't build Qt on the RPi. The many hours that it takes is longer than the RPi can survive it. My 8GB machine always ends up hanging after many hours and only 1/4 through the build.

        (It would be nice if there were some Qt distributions for the RPi. That would avoid all of the pain being duplicated over and over by everyone.)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SwimRideRunCode
          wrote last edited by
          #4

          Well, I just tried apt install qt6-base-dev on my RPi (after seeing it listed in my Linux Mint package manager) and it's started installing. I'm using Ubuntu on the RPi.
          OMG! What time I've wasted. I'll post back if it's all successful.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SwimRideRunCode
            wrote last edited by
            #5

            Yep, I was able to install everything I need from Qt6 on RPi Ubuntu.
            Setting...

            set(CMAKE_PREFIX_PATH "usr/lib/aarch64-linux-gnu/cmake/")
            

            ...allowed CMake to find everything.

            Like one of my highschool maths teachers used to say, "Don't do it how I've shown you on the board."

            1 Reply Last reply
            1
            • S SwimRideRunCode has marked this topic as solved

            • Login

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