【问题标题】:CLIon - can't get visual studio toolchain to work: cannot open file 'MSVCRTD.lib'CLIon - 无法让 Visual Studio 工具链工作:无法打开文件“MSVCRTD.lib”
【发布时间】:2020-05-11 07:40:56
【问题描述】:
CMake Error at C:/Program Files/JetBrains/CLion 2019.1.3/bin/cmake/win/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/dbak/Projects/firmware/testing/cmake-build-release-visual-studio/CMakeFiles/CMakeTmp

    Run Build Command(s):nmake /nologo cmTC_99064\fast 
        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe" -f CMakeFiles\cmTC_99064.dir\build.make /nologo -L                  CMakeFiles\cmTC_99064.dir\build
    Building C object CMakeFiles/cmTC_99064.dir/testCCompiler.c.obj
        C:\PROGRA~2\MICROS~1\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe @C:\Users\dbak\AppData\Local\Temp\nm9D03.tmp
    testCCompiler.c
    Linking C executable cmTC_99064.exe
        "C:\Program Files\JetBrains\CLion 2019.1.3\bin\cmake\win\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_99064.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\10.0.17763.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\10.0.17763.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_99064.dir\objects1.rsp @C:\Users\dbak\AppData\Local\Temp\nm9E1D.tmp
    LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_99064.dir\objects1.rsp /out:cmTC_99064.exe /implib:cmTC_99064.lib /pdb:C:\Users\dbak\Projects\firmware\testing\cmake-build-release-visual-studio\CMakeFiles\CMakeTmp\cmTC_99064.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_99064.dir/intermediate.manifest CMakeFiles\cmTC_99064.dir/manifest.res" failed (exit code 1104) with the following output:
    LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'
    NMAKE : fatal error U1077: '"C:\Program Files\JetBrains\CLion 2019.1.3\bin\cmake\win\bin\cmake.exe"' : return code '0xffffffff'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
    Stop.




  CMake will not be able to correctly generate this project.


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.14)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".

但是,MSVCRTD.lib 位于“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64”。所以我不知道我能做什么。这是 Clion 在路径中没有该位置的问题吗?

【问题讨论】:

  • 您的 CLion Toolchain 设置是什么?
  • x86_arm, uwp Cmake: bundled 就是这样。
  • 尝试将您的工具链更改为 64 位。 CLion 似乎正在寻找 Visual Studio x64 编译器库。

标签: visual-studio cmake clion


【解决方案1】:

也许将架构更改为x86Where to find architecture setting

【讨论】:

    猜你喜欢
    • 2017-01-07
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 2019-12-30
    • 1970-01-01
    • 2022-09-23
    • 2014-05-10
    相关资源
    最近更新 更多