Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. LNK1104: cannot open file 'libucrt.lib'

LNK1104: cannot open file 'libucrt.lib'

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
4 Posts 2 Posters 373 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.
  • A Offline
    A Offline
    Aman55
    wrote on 4 Feb 2025, 06:45 last edited by
    #1

    Integrating QGIS in Qtcreator qt 5.15
    I am getting fatal error LNK1104: cannot open file 'libucrt.lib' while compiling cmakelist with qtcreator. I have already check libucrt.lib file present at this path(C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64) and i have added path in enviornment variable in the PATH.
    HOW to fix now?

    [cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/OSGeo4W/QGIS -B C:/OSGeo4W/QGIS/buildQt "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PREFIX_PATH:PATH=" "-DCMAKE_GENERATOR_PLATFORM:STRING=x64" "-DCMAKE_GENERATOR:STRING=Visual Studio 17 2022" "-DQT_QMAKE_EXECUTABLE:FILEPATH=" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_GENERATOR_TOOLSET:STRING=v142" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\OSGeo4W\QGIS\buildQt/.qtc/package-manager/auto-setup.cmake" in C:\OSGeo4W\QGIS\buildQt.
    [cmake] -- Building with system libraries --
    [cmake] -- The C compiler identification is unknown
    [cmake] -- The CXX compiler identification is unknown
    [cmake] -- Detecting C compiler ABI info
    [cmake] -- Detecting C compiler ABI info - failed
    [cmake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe
    [cmake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe - broken
    [cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
    [cmake]   The C compiler
    [cmake] 
    [cmake]     "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe"
    [cmake] 
    [cmake]   is not able to compile a simple test program.
    [cmake] 
    [cmake]   It fails with the following output:
    [cmake] 
    [cmake]     Change Dir: 'C:/OSGeo4W/QGIS/buildQt/CMakeFiles/CMakeScratch/TryCompile-7033nj'
    [cmake]     
    [cmake]     Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_3b7cd.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n
    [cmake]     MSBuild version 17.12.12+1cce77968 for .NET Framework
    [cmake]     Build started 2/4/2025 12:08:45 PM.
    [cmake]     
    [cmake]     Project "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj" on node 1 (default targets).
    [cmake]     PrepareForBuild:
    [cmake]       Creating directory "cmTC_3b7cd.dir\Debug\".
    [cmake]       Creating directory "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\Debug\".
    [cmake]       Creating directory "cmTC_3b7cd.dir\Debug\cmTC_3b7cd.tlog\".
    [cmake]     InitializeBuildStatus:
    [cmake]       Creating "cmTC_3b7cd.dir\Debug\cmTC_3b7cd.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
    [cmake]       Touching "cmTC_3b7cd.dir\Debug\cmTC_3b7cd.tlog\unsuccessfulbuild".
    [cmake]     ClCompile:
    [cmake]       C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\CL.exe /c /W1 /WX- /diagnostics:column /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_3b7cd.dir\Debug\\" /Fd"cmTC_3b7cd.dir\Debug\vc142.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\testCCompiler.c"
    [cmake]       Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30158 for x64
    [cmake]       Copyright (C) Microsoft Corporation.  All rights reserved.
    [cmake]       testCCompiler.c
    [cmake]       cl /c /W1 /WX- /diagnostics:column /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_3b7cd.dir\Debug\\" /Fd"cmTC_3b7cd.dir\Debug\vc142.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\testCCompiler.c"
    [cmake]     Link:
    [cmake]       C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\Debug\cmTC_3b7cd.exe" /INCREMENTAL /ILK:"cmTC_3b7cd.dir\Debug\cmTC_3b7cd.ilk" /NOLOGO /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/OSGeo4W/QGIS/buildQt/CMakeFiles/CMakeScratch/TryCompile-7033nj/Debug/cmTC_3b7cd.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/OSGeo4W/QGIS/buildQt/CMakeFiles/CMakeScratch/TryCompile-7033nj/Debug/cmTC_3b7cd.lib" /MACHINE:X64 cmTC_3b7cd.dir\Debug\testCCompiler.obj
    [cmake]     LINK : fatal error LNK1104: cannot open file 'libucrt.lib' [C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj]
    [cmake]     Done Building Project "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj" (default targets) -- FAILED.
    [cmake]     
    [cmake]     Build FAILED.
    [cmake]     
    [cmake]     "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj" (default target) (1) ->
    [cmake]     (Link target) -> 
    [cmake]       LINK : fatal error LNK1104: cannot open file 'libucrt.lib' [C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj]
    [cmake]     
    [cmake]         0 Warning(s)
    [cmake]         1 Error(s)
    [cmake]     
    [cmake]     Time Elapsed 00:00:01.13
    [cmake]     
    [cmake]     
    [cmake] 
    [cmake]   
    [cmake] 
    [cmake]   CMake will not be able to correctly generate this project.
    [cmake] Call Stack (most recent call first):
    [cmake]   CMakeLists.txt:63 (project)
    [cmake] 
    [cmake] 
    [cmake] -- Configuring incomplete, errors occurred!
    [cmake] 
    [cmake] The command "C:\Program Files\CMake\bin\cmake.exe -S C:/OSGeo4W/QGIS -B C:/OSGeo4W/QGIS/buildQt "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PREFIX_PATH:PATH=" "-DCMAKE_GENERATOR_PLATFORM:STRING=x64" "-DCMAKE_GENERATOR:STRING=Visual Studio 17 2022" "-DQT_QMAKE_EXECUTABLE:FILEPATH=" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_GENERATOR_TOOLSET:STRING=v142" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\OSGeo4W\QGIS\buildQt/.qtc/package-manager/auto-setup.cmake"" terminated with exit code 1.
    [cmake] 
    [cmake] Elapsed time: 00:11. 
    
    J 1 Reply Last reply 4 Feb 2025, 06:53
    0
    • A Aman55
      4 Feb 2025, 06:45

      Integrating QGIS in Qtcreator qt 5.15
      I am getting fatal error LNK1104: cannot open file 'libucrt.lib' while compiling cmakelist with qtcreator. I have already check libucrt.lib file present at this path(C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64) and i have added path in enviornment variable in the PATH.
      HOW to fix now?

      [cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/OSGeo4W/QGIS -B C:/OSGeo4W/QGIS/buildQt "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PREFIX_PATH:PATH=" "-DCMAKE_GENERATOR_PLATFORM:STRING=x64" "-DCMAKE_GENERATOR:STRING=Visual Studio 17 2022" "-DQT_QMAKE_EXECUTABLE:FILEPATH=" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_GENERATOR_TOOLSET:STRING=v142" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\OSGeo4W\QGIS\buildQt/.qtc/package-manager/auto-setup.cmake" in C:\OSGeo4W\QGIS\buildQt.
      [cmake] -- Building with system libraries --
      [cmake] -- The C compiler identification is unknown
      [cmake] -- The CXX compiler identification is unknown
      [cmake] -- Detecting C compiler ABI info
      [cmake] -- Detecting C compiler ABI info - failed
      [cmake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe
      [cmake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe - broken
      [cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
      [cmake]   The C compiler
      [cmake] 
      [cmake]     "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe"
      [cmake] 
      [cmake]   is not able to compile a simple test program.
      [cmake] 
      [cmake]   It fails with the following output:
      [cmake] 
      [cmake]     Change Dir: 'C:/OSGeo4W/QGIS/buildQt/CMakeFiles/CMakeScratch/TryCompile-7033nj'
      [cmake]     
      [cmake]     Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_3b7cd.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n
      [cmake]     MSBuild version 17.12.12+1cce77968 for .NET Framework
      [cmake]     Build started 2/4/2025 12:08:45 PM.
      [cmake]     
      [cmake]     Project "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj" on node 1 (default targets).
      [cmake]     PrepareForBuild:
      [cmake]       Creating directory "cmTC_3b7cd.dir\Debug\".
      [cmake]       Creating directory "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\Debug\".
      [cmake]       Creating directory "cmTC_3b7cd.dir\Debug\cmTC_3b7cd.tlog\".
      [cmake]     InitializeBuildStatus:
      [cmake]       Creating "cmTC_3b7cd.dir\Debug\cmTC_3b7cd.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
      [cmake]       Touching "cmTC_3b7cd.dir\Debug\cmTC_3b7cd.tlog\unsuccessfulbuild".
      [cmake]     ClCompile:
      [cmake]       C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\CL.exe /c /W1 /WX- /diagnostics:column /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_3b7cd.dir\Debug\\" /Fd"cmTC_3b7cd.dir\Debug\vc142.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\testCCompiler.c"
      [cmake]       Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30158 for x64
      [cmake]       Copyright (C) Microsoft Corporation.  All rights reserved.
      [cmake]       testCCompiler.c
      [cmake]       cl /c /W1 /WX- /diagnostics:column /D _MBCS /D "CMAKE_INTDIR=\"Debug\"" /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_3b7cd.dir\Debug\\" /Fd"cmTC_3b7cd.dir\Debug\vc142.pdb" /external:W1 /Gd /TC /errorReport:queue "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\testCCompiler.c"
      [cmake]     Link:
      [cmake]       C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\Debug\cmTC_3b7cd.exe" /INCREMENTAL /ILK:"cmTC_3b7cd.dir\Debug\cmTC_3b7cd.ilk" /NOLOGO /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/OSGeo4W/QGIS/buildQt/CMakeFiles/CMakeScratch/TryCompile-7033nj/Debug/cmTC_3b7cd.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/OSGeo4W/QGIS/buildQt/CMakeFiles/CMakeScratch/TryCompile-7033nj/Debug/cmTC_3b7cd.lib" /MACHINE:X64 cmTC_3b7cd.dir\Debug\testCCompiler.obj
      [cmake]     LINK : fatal error LNK1104: cannot open file 'libucrt.lib' [C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj]
      [cmake]     Done Building Project "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj" (default targets) -- FAILED.
      [cmake]     
      [cmake]     Build FAILED.
      [cmake]     
      [cmake]     "C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj" (default target) (1) ->
      [cmake]     (Link target) -> 
      [cmake]       LINK : fatal error LNK1104: cannot open file 'libucrt.lib' [C:\OSGeo4W\QGIS\buildQt\CMakeFiles\CMakeScratch\TryCompile-7033nj\cmTC_3b7cd.vcxproj]
      [cmake]     
      [cmake]         0 Warning(s)
      [cmake]         1 Error(s)
      [cmake]     
      [cmake]     Time Elapsed 00:00:01.13
      [cmake]     
      [cmake]     
      [cmake] 
      [cmake]   
      [cmake] 
      [cmake]   CMake will not be able to correctly generate this project.
      [cmake] Call Stack (most recent call first):
      [cmake]   CMakeLists.txt:63 (project)
      [cmake] 
      [cmake] 
      [cmake] -- Configuring incomplete, errors occurred!
      [cmake] 
      [cmake] The command "C:\Program Files\CMake\bin\cmake.exe -S C:/OSGeo4W/QGIS -B C:/OSGeo4W/QGIS/buildQt "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PREFIX_PATH:PATH=" "-DCMAKE_GENERATOR_PLATFORM:STRING=x64" "-DCMAKE_GENERATOR:STRING=Visual Studio 17 2022" "-DQT_QMAKE_EXECUTABLE:FILEPATH=" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_GENERATOR_TOOLSET:STRING=v142" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\OSGeo4W\QGIS\buildQt/.qtc/package-manager/auto-setup.cmake"" terminated with exit code 1.
      [cmake] 
      [cmake] Elapsed time: 00:11. 
      
      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 4 Feb 2025, 06:53 last edited by
      #2

      @Aman55 Is your Kit configured properly? Any warnings/errors there?

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

      A 1 Reply Last reply 4 Feb 2025, 06:58
      0
      • J jsulm
        4 Feb 2025, 06:53

        @Aman55 Is your Kit configured properly? Any warnings/errors there?

        A Offline
        A Offline
        Aman55
        wrote on 4 Feb 2025, 06:58 last edited by
        #3

        @jsulm yes My Kit configured properly
        Screenshot (11).png

        J 1 Reply Last reply 4 Feb 2025, 07:08
        0
        • A Aman55
          4 Feb 2025, 06:58

          @jsulm yes My Kit configured properly
          Screenshot (11).png

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 4 Feb 2025, 07:08 last edited by
          #4

          @Aman55

          • Qt version is not set in the Kit
          • You should use CMake provided by Qt Online Installer
          • In the screen-shot there is yellow exclamation mark, but the message is cut, check that also

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

          1 Reply Last reply
          0

          4/4

          4 Feb 2025, 07:08

          • Login

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