Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. qmake fails to find libraries
QtWS25 Last Chance

qmake fails to find libraries

Scheduled Pinned Locked Moved Solved Installation and Deployment
6 Posts 3 Posters 2.0k 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.
  • F Offline
    F Offline
    fatih.erol
    wrote on last edited by
    #1

    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
    
    jsulmJ 1 Reply Last reply
    0
    • F Offline
      F Offline
      fatih.erol
      wrote on last edited by
      #6

      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
      1
      • F fatih.erol

        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
        
        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @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
        0
        • F Offline
          F Offline
          fatih.erol
          wrote on last edited by
          #3

          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.

          jsulmJ 1 Reply Last reply
          0
          • F fatih.erol

            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.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @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

            sierdzioS 1 Reply Last reply
            0
            • jsulmJ jsulm

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

              sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #5

              @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
              1
              • F Offline
                F Offline
                fatih.erol
                wrote on last edited by
                #6

                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
                1

                • Login

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