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. Makefile cannot find libQtCore while libQt5Core exist
Forum Updated to NodeBB v4.3 + New Features

Makefile cannot find libQtCore while libQt5Core exist

Scheduled Pinned Locked Moved Solved Installation and Deployment
4 Posts 2 Posters 538 Views 2 Watching
  • 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.
  • thomastT Offline
    thomastT Offline
    thomast
    wrote on last edited by
    #1

    Hello,
    I compiled Qt5 to use on a debian docker. I packaged the install folder and installed it in /usr/local/lib and i had that path to the ld path (so I have all the usual libQt5Core.so in the ld file, when I try that with g++ -lQt5Core it works and find the lib).

    I have a CMake also for the project using Qt on the docker that find the Qt5 Components just fine, I also have a target_link_libaries set with the correct lib (including Qt) so my cmake works fine.
    After that though, when I try the make command, my project fails pretty quickly saying that ld couldn't find -lQtCore

    I don't understand what I did wrong. Why cmake gives me a Makefile with -lQtCore when it should have been -lQt5Core ?

    Thanks for your help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you sure cmake does not find your distribution Qt 4 libraries rather than your self built Qt 5 ?

      How are you doing the find with cmake ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • thomastT Offline
        thomastT Offline
        thomast
        wrote on last edited by
        #3

        Hi, thank you,
        Sorry for the late reply, I had covid

        I use a cmake with the likes of

        find_package(Qt5 COMPONENTS Widgets REQUIRED)
        

        with all the required components and then

        target_link_libraries(application Qt5::Widgets)
        

        And since it's in a docker run, I made sure (I hope) that there was no Qt4 install. I will double check just in case of some forgotten apt-get in the dockerfile.

        1 Reply Last reply
        0
        • thomastT Offline
          thomastT Offline
          thomast
          wrote on last edited by
          #4

          I fixed it, I had other CMakeFiles that were not updated and still had QtCore in the target_link_libraries.

          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