Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt attempts to link library that is never referenced
Qt 6.11 is out! See what's new in the release blog

Qt attempts to link library that is never referenced

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
9 Posts 3 Posters 4.7k Views 1 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.
  • P Offline
    P Offline
    Pietrko
    wrote on last edited by Pietrko
    #1

    Platform: Windows 10
    Qt: 5.9 Precompiled binaries
    Complier: Microsoft Visual Studio C++ compiler 15 (MSVC)
    Build Kit: Qt.5.9.0 for UWP 64bit (MSVC2017)

    I am getting following error while trying to compile project in QtCreator that depends on third party library (realsesne from Intel).
    Single line:

    LNK1181: cannot open input file '.........\librealsense\bin\Win32\realsense.lib'
    

    The path ........\librealsense\bin\Win32\realsense.lib is never referenced in project files.
    The only reference is made to x64 bit version of "realsense.lib"

    ........\librealsense\bin\x64\realsense.lib
    

    Like this:
    LIBS += "C:........\librealsense\bin\x64\realsense.lib"

    The Windows PATH variable does not reference the location of this library either.
    How is it possible?
    The ........\librealsense\bin\x64\realsense.lib is existing.

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, just guessing, but how did you create that subdirectory "........"?

      (Dots are allowed in directory names, but they have to be prefixed and suffixed by something else, for example A........Z)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Pietrko
        wrote on last edited by Pietrko
        #3

        The dots ..... are used to represent lengthy (but proper) Windows path. I'm simply not showing it, beacuse it is not relevant.

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

          Hi,

          Was librealsense also compiled for VS2017 ?

          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
          • P Offline
            P Offline
            Pietrko
            wrote on last edited by Pietrko
            #5

            Hi, nice to see familiar face :)
            Librealsense was compiled using Visual Studio 2017 both for 64 and 32 bit target.
            Also, check first post I've updated the details of build kit (names).

            What bothers me is that qmake takes -spec msvc32 as parameter for 32 and 64 build kits. But i guess its historic stuff.

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

              The usual thing to do when linking to a library is:

              LIBS += -LC:/....../librealsense/bin/x64 -lrealsense
              

              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
              • P Offline
                P Offline
                Pietrko
                wrote on last edited by Pietrko
                #7

                @SGaist said in Qt attempts to link library that is never referenced:

                LIBS += -LC:/....../librealsense/bin/x64 -lrealsense

                I've changed it - no difference.

                Btw I;m getting a warning:

                C:\\Program Files (x86)\....\MSVC\14.19.25917\bin]HostX86]x64\d.exe is used by qmake but "" is 
                configured in the kid.
                Please update your ki or choose a mkspec for qmke that matches your target platform.
                

                EDIT:
                Maybe it is important: realsense was compiled in Visual Studio, not in QtCreator (that uses visual studio compiler).

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

                  No, it should not matter, Qt Creator will use the compiler matching the Qt version you installed.

                  Just one thing I realised, which exact version of Qt did you install ?

                  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
                  • P Offline
                    P Offline
                    Pietrko
                    wrote on last edited by Pietrko
                    #9

                    Qt 5.9 downloaded using qt-unified-windows-x86 (online installer).
                    I installed packages for UWP 32bit, UWP64 bit and 32bit MinGW

                    Btw I now removed to whole building directory (manually) and rebuilded the project and it does not complain.

                    I'm puzzled here, will mark it solved after a few more tests.

                    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