【问题标题】:Cmake Visual Studio 2013 errorCmake Visual Studio 2013 错误
【发布时间】:2014-04-03 16:48:01
【问题描述】:

我正在尝试通过 cmake gui 运行一个简单的程序,我收到以下输出。我不太确定问题出在哪里,请原谅我,因为我对此很陌生。我还卸载并安装了 Visual Studio 2012 和 2013,看看这是否会有所作为。我使用 Visual Studio 2013 作为编译器并得到以下配置错误。

我的环境是:
Windows 7 企业版 64 位
Cmake gui 2.8.12.2
Visual Studio 2013 专业版

The C compiler identification is MSVC 18.0.21005.1
The CXX compiler identification is MSVC 18.0.21005.1
Check for working C compiler using: Visual Studio 12
Check for working C compiler using: Visual Studio 12 -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  12.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Users/PM&R/Desktop/CMakeFiles/CMakeTmp



  Run Build Command:C:\PROGRA~2\MSBuild\12.0\Bin\MSBuild.exe
  cmTryCompileExec3676669247.vcxproj /p:Configuration=Debug
  /p:VisualStudioVersion=12.0

  Microsoft (R) Build Engine version 12.0.21005.1


  [Microsoft .NET Framework, version 4.0.30319.18444]


  Copyright (C) Microsoft Corporation.  All rights reserved.





  Build started 3/31/2014 2:27:43 PM.


  Project
  "C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
  on node 1 (default targets).



  C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85):
  error MSB4025: The project file could not be loaded.  An error occurred
  while parsing EntityName.  Line 60, position 85.


  Done Building Project
  "C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
  (default targets) -- FAILED.





  Build FAILED.






  "C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
  (default target) (1) ->


    C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85): error MSB4025: The project file could not be loaded. An error occurred while parsing EntityName. Line 60, position 85.





      0 Warning(s)

      1 Error(s)





  Time Elapsed 00:00:00.02






  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


Configuring incomplete, errors occurred!
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeOutput.log".
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeError.log".

【问题讨论】:

  • 你使用什么目标生成器?
  • 您对用户“PM&R”个人文件夹有写入权限吗?更改生成器后,您是否完全删除了 cmake 的缓存?尝试在 C:/Tmp 等文件夹中生成构建系统,如果它不仅仅是路径问题上的写入问题/非法字符。
  • @user3482370 如果可行,您可以接受下面的答案。谢谢

标签: visual-studio-2012 cmake visual-studio-2013


【解决方案1】:

尝试在文件夹 C:/Tmp 中生成构建系统,以测试问题是否与损坏的缓存或路径问题有关。将其构建到问题中所述的文件夹:

  • 检查您是否拥有“PM&R”个人文件夹的写入权限
  • 更改生成器时删除 cmake 缓存

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-18
    • 1970-01-01
    • 1970-01-01
    • 2017-04-28
    • 2016-07-09
    • 2014-01-09
    • 2014-07-15
    相关资源
    最近更新 更多