缺少C& Windows子系统Linux中的C ++编译器

时间:2016-06-17 07:46:23

标签: windows bash cmake windows-10 subsystem

我正在尝试使用适用于Linux的Windows子系统(Windows 10版本10.0.14342)编译LLVM,但我不断发现cmake错误,因为我错过了C& C C ++编译器。尽管通过在bash中使用apt-get而拥有gcc,g ++和build-essentials。我的命令如下:

{{1}}

我从CMake那里得到了一堆错误

CMake Error: Parse error in cache file /home/andrew-wsl/llvm/build/CMakeCache.txt. 
Offending entry: Debug Info builds.
CMake Error: Parse error in cache file /home/andrew-wsl/llvm/build/CMakeCache.txt. 
Offending entry: CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED
-- The C compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:186 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:54 (project)


-- The CXX compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:185 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:54 (project)


-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
  Unknown extension ".c" for file

    /home/andrew-wsl/llvm/build/CMakeFiles/CMakeTmp/testCCompiler.c

  try_compile() works only for enabled languages.  Currently these are:

    ASM C CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:54 (project)


-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:





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


-- Configuring incomplete, errors occurred!
See also "/home/andrew-wsl/llvm/build/CMakeFiles/CMakeOutput.log".
See also "/home/andrew-wsl/llvm/build/CMakeFiles/CMakeError.log".
andrew-wsl@COMPUTER:~/llvm/build$

CMakeError.log可以在这里找到:http://square.github.io/picasso/2.x/picasso/

可以在此处找到CMakeOutput.log:http://pastebin.com/7rWYFGu5

我不知道发生了什么,因为我能够成功地用gcc和g ++编译helloworld程序。

1 个答案:

答案 0 :(得分:1)

原来这是一个已知的错误:https://github.com/Microsoft/BashOnWindows/issues/272

长话短说,从14352版本开始就已修复。

相关问题