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. fatal error LNK1104: cannot open file 'C:\Qt\5.15.2\msvc2019_64\lib.obj
Forum Updated to NodeBB v4.3 + New Features

fatal error LNK1104: cannot open file 'C:\Qt\5.15.2\msvc2019_64\lib.obj

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 4 Posters 1.1k 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.
  • J Offline
    J Offline
    james b-s
    wrote on 30 May 2024, 13:48 last edited by james b-s
    #1

    Just installed qt 6.7.1. There appears to be an old installation on my system
    Windows 11. Visual studio 2022
    Installed the visual studio qt add-in (qt visual studio tools version 3.2.0 (rev 47))
    qt/versions is set to 6.7.1\msvc2019_64. For some reason 5.15.2\msvc2019 shows up in the list but isn't selected.

    The visual studio additional include directories is set to %(AdditionalIncludeDirectories);$(ProjectDir);$(Qt_INCLUDEPATH_);E:\qtnodes\include;E:\qtnodes\examples\lock_nodes_and_connections;$(QTDIR)/include;$(QTDIR)/include/QtWidgets

    I think I had to add some stuff to that to get things to compile. Everything compiles now.

    When I try to build, I get fatal error LNK1104: cannot open file 'C:\Qt\5.15.2\msvc2019_64\lib.obj. For some reason, qt has visual studio looking at 5.15.2 instead of 6.7.1

    The linker additional dependencies is currently set to %(AdditionalDependencies);$(Qt_LIBS_);$(QTDIR)\lib
    I added the last one, but it didn't make any difference.

    The system environment variables does not show any environment variables for qt, but I suspect that is OK.

    Not sure what to try next. I expected the visual studio addin to just configure things so that they would work. It always has in the past.

    I just noticed that that isn't the first thing going wrong. Evidently, it is trying to read the 5.15.2 confiuration

    Build started...
    1>------ Build started: Project: QtQuickApplication1, Configuration: Debug x64 ------
    1>Reading Qt configuration (C:/Qt/5.15.2/msvc2019_64/bin/qmake)
    1>DelegateNodeModel.cpp
    1>main.cpp
    1>qrc_qml.cpp
    1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1096,5): error MSB6006: "link.exe" exited with code 1104.
    1>LINK : fatal error LNK1104: cannot open file 'C:\Qt\5.15.2\msvc2019_64\lib.obj'
    1>Done building project "QtQuickApplication1.vcxproj" -- FAILED.

    Also, my qt installation is on my e drive. It is looking on the c drive

    Update: The <PropertyGroup>/<QtInstall> setting in the VS project file was set wrong. I've changed it to 6.7.1_msvc2019_64. The build is now looking in the right area, but it still can't find lib.obj.

    1>LINK : fatal error LNK1104: cannot open file 'E:\Qt\6.7.1\msvc2019_64\lib.obj'

    J 1 Reply Last reply 31 May 2024, 06:06
    0
    • J james b-s
      30 May 2024, 13:48

      Just installed qt 6.7.1. There appears to be an old installation on my system
      Windows 11. Visual studio 2022
      Installed the visual studio qt add-in (qt visual studio tools version 3.2.0 (rev 47))
      qt/versions is set to 6.7.1\msvc2019_64. For some reason 5.15.2\msvc2019 shows up in the list but isn't selected.

      The visual studio additional include directories is set to %(AdditionalIncludeDirectories);$(ProjectDir);$(Qt_INCLUDEPATH_);E:\qtnodes\include;E:\qtnodes\examples\lock_nodes_and_connections;$(QTDIR)/include;$(QTDIR)/include/QtWidgets

      I think I had to add some stuff to that to get things to compile. Everything compiles now.

      When I try to build, I get fatal error LNK1104: cannot open file 'C:\Qt\5.15.2\msvc2019_64\lib.obj. For some reason, qt has visual studio looking at 5.15.2 instead of 6.7.1

      The linker additional dependencies is currently set to %(AdditionalDependencies);$(Qt_LIBS_);$(QTDIR)\lib
      I added the last one, but it didn't make any difference.

      The system environment variables does not show any environment variables for qt, but I suspect that is OK.

      Not sure what to try next. I expected the visual studio addin to just configure things so that they would work. It always has in the past.

      I just noticed that that isn't the first thing going wrong. Evidently, it is trying to read the 5.15.2 confiuration

      Build started...
      1>------ Build started: Project: QtQuickApplication1, Configuration: Debug x64 ------
      1>Reading Qt configuration (C:/Qt/5.15.2/msvc2019_64/bin/qmake)
      1>DelegateNodeModel.cpp
      1>main.cpp
      1>qrc_qml.cpp
      1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1096,5): error MSB6006: "link.exe" exited with code 1104.
      1>LINK : fatal error LNK1104: cannot open file 'C:\Qt\5.15.2\msvc2019_64\lib.obj'
      1>Done building project "QtQuickApplication1.vcxproj" -- FAILED.

      Also, my qt installation is on my e drive. It is looking on the c drive

      Update: The <PropertyGroup>/<QtInstall> setting in the VS project file was set wrong. I've changed it to 6.7.1_msvc2019_64. The build is now looking in the right area, but it still can't find lib.obj.

      1>LINK : fatal error LNK1104: cannot open file 'E:\Qt\6.7.1\msvc2019_64\lib.obj'

      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 31 May 2024, 06:06 last edited by
      #2

      @james-b-s said in fatal error LNK1104: cannot open file 'C:\Qt\5.15.2\msvc2019_64\lib.obj:

      cannot open file 'E:\Qt\6.7.1\msvc2019_64\lib.obj'

      I'm wondering what lib.obj supposed to be?

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

      1 Reply Last reply
      1
      • H Offline
        H Offline
        hskoglund
        wrote on 31 May 2024, 06:29 last edited by
        #3

        Hi, the culprit might be that $(QTDIR)\lib you added as a linker additional dependency, so even though that directory does not contain any *.lib files (only the subdirectories do) the linker adds that as a dummy .lib file anyway (note: just a guess :-)

        1 Reply Last reply
        2
        • V Offline
          V Offline
          visa
          wrote 16 days ago last edited by visa 6 Jan 2025, 10:58
          #4

          I hit the same problem when compiling hpp_proto after configuring and generating CS2022 solution.
          I got
          fatal error LNK1104: cannot open file '..\vcpkg\installed\x64-windows\debug\lib.obj'

          the generator had added "..\vcpkg\installed\x64-windows\debug\lib" instead of "..\vcpkg\installed\x64-windows\debug\zlibd.lib" under %AdditionalDependencies%

          Fixing that solved my issue.

          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