Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Solved qmake fails to find libraries

    Installation and Deployment
    3
    6
    1441
    Loading More Posts
    • 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.
    • F
      fatih.erol last edited by

      I have cross-compiled qt 5.9.4 on a 64-bit Ubuntu host for a 32-bit ArchLinux target. I can use the cross-compilation toolchain to build a Qt application using CMAKE on the 64-bit Ubuntu host and run on the 32-bit target.

      I can build and run the same application also natively on 32-bit target using CMAKE.

      However, when I try to build the application natively with QMAKE, it gives the following error:

      Project ERROR: Unknown module(s) in QT: core gui widgets
      

      The QMAKE on the target device was generated by building qtbase natively on the 32-bit target, and copying the executables under /usr/lib/qt/bin. The qt.conf file is under the same directory and contains the following. How can I make sure QMAKE finds the qt libraries which are installed in /usr/lib? I have already tried adding Libraries=lib to the qt.conf file.

      [EffectivePaths]
      Prefix=..
      [DevicePaths]
      Prefix=/usr
      Documentation=share/doc/qt
      Headers=include/qt
      LibraryExecutables=lib/qt/libexec
      Plugins=lib/qt/plugins
      Imports=lib/qt/imports
      Qml2Imports=lib/qt/qml
      ArchData=lib/qt
      Data=share/qt
      Translations=share/qt/translations
      Examples=share/doc/qt/examples
      [Paths]
      Prefix=/usr
      Documentation=share/doc/qt
      Headers=include/qt
      LibraryExecutables=lib/qt/libexec
      Plugins=lib/qt/plugins
      Imports=lib/qt/imports
      Qml2Imports=lib/qt/qml
      ArchData=lib/qt
      Data=share/qt
      Translations=share/qt/translations
      Examples=share/doc/qt/examples
      HostPrefix=/usr
      HostData=lib/qt
      Sysroot=
      SysrootifyPrefix=false
      TargetSpec=linux-g++
      HostSpec=linux-g++
      [EffectiveSourcePaths]
      Prefix=/home/root/qt/sources
      
      jsulm 1 Reply Last reply Reply Quote 0
      • F
        fatih.erol last edited by

        It turns out that 'modules' directory was missing from '/usr/lib/qt/mkspecs' directory. Somehow, it was not installed properly (make install_mkspecs) on the target. I re-built qtbase on the target from scratch, and it seems to work now.

        Thank you for your answers.

        1 Reply Last reply Reply Quote 1
        • jsulm
          jsulm Lifetime Qt Champion @fatih.erol last edited by

          @fatih.erol Did you build QtCore, QtGui and QtWidgets modules as well (not only qmake)?

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

          1 Reply Last reply Reply Quote 0
          • F
            fatih.erol last edited by

            yes, but the libraries are cross-compiled. cmake finds them.
            qmake/qlalr/moc/rcc/uic are built natively on the target. but qmake fails to find them.

            jsulm 1 Reply Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @fatih.erol last edited by

              @fatih.erol If you use native compiled qmake you need Qt libs as well on the same machine.

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

              sierdzio 1 Reply Last reply Reply Quote 0
              • sierdzio
                sierdzio Moderators @jsulm last edited by

                @jsulm said in qmake fails to find libraries:

                @fatih.erol If you use native compiled qmake you need Qt libs as well on the same machine.

                He has the libs on the same machine :-) But not compiled natively, only cross-compiled. They should be bit-for-bit the same, though. I'd rather suspect that qmake does not pick up the paths from qt.conf and tries to load libs from compilation path instead.

                (Z(:^

                1 Reply Last reply Reply Quote 1
                • F
                  fatih.erol last edited by

                  It turns out that 'modules' directory was missing from '/usr/lib/qt/mkspecs' directory. Somehow, it was not installed properly (make install_mkspecs) on the target. I re-built qtbase on the target from scratch, and it seems to work now.

                  Thank you for your answers.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post