【问题标题】:Trying to use JetBrains CLion, but Cmake - c++ compiler broken after cygwin install尝试使用 JetBrains CLion,但 Cmake - c++ 编译器在 cygwin 安装后损坏
【发布时间】:2017-05-12 05:04:12
【问题描述】:

我一直在尝试让 JetBrains CLion IDE 工作,但我在使用 Cmake 时遇到了问题,而且我的在线研究都没有帮助。我安装了 cygwin 和必要的软件包(如 here - gcc/g++、cmake、make、gdb 所述)。当我打开 CLion 并进入 Build>Toolchains>Debugger 下的 Settings(我正在运行 Windows 10)时,所有内容旁边都有一个检查,所以 CLion 似乎发现一切正常,但是当我查看 Debugger 窗口时,我得到以下错误:

    "C:\Users\Lucas Lofaro\.CLion2016.3\system\cygwin_cmake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview"
    -- The CXX compiler identification is GNU 5.3.0
    -- Check for working CXX compiler: /usr/bin/c++.exe
    -- Check for working CXX compiler: /usr/bin/c++.exe -- broken
    CMake Error at /cygdrive/c/Users/Lucas Lofaro/.CLion2016.3/system/cygwin_cmake/share/cmake-3.6.2/Modules/CMakeTestCXXCompiler.cmake:54 (message):
      The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test
      program.

      It fails with the following output:

       Change Dir: /cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp



      Run Build Command:"/usr/bin/make.exe" "cmTC_96921/fast"

      /usr/bin/make -f CMakeFiles/cmTC_96921.dir/build.make
      CMakeFiles/cmTC_96921.dir/build

      make[1]: Entering directory '/cygdrive/c/Users/Lucas
      Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp'


      Building CXX object CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o

      /usr/bin/c++.exe -o CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o -c
      "/cygdrive/c/Users/Lucas
      Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx"


      Linking CXX executable cmTC_96921.exe

      "/cygdrive/c/Users/Lucas
      Lofaro/.CLion2016.3/system/cygwin_cmake/bin/cmake.exe" -E cmake_link_script
      CMakeFiles/cmTC_96921.dir/link.txt --verbose=1

      /usr/bin/c++.exe -Wl,--enable-auto-import
      CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o -o cmTC_96921.exe
      -Wl,--out-implib,libcmTC_96921.dll.a
      -Wl,--major-image-version,0,--minor-image-version,0

      c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found

      compilation terminated.

      CMakeFiles/cmTC_96921.dir/build.make:97: recipe for target 'cmTC_96921.exe'
      failed

      make[1]: *** [cmTC_96921.exe] Error 1

      make[1]: Leaving directory '/cygdrive/c/Users/Lucas
      Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp'


      Makefile:126: recipe for target 'cmTC_96921/fast' failed

      make: *** [cmTC_96921/fast] Error 2





      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 "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeOutput.log".
    See also "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeError.log".

我还将 cygwin bin 目录添加到我的 Path 环境变量中,但我真的不知道下一步该做什么。有些东西没有连接起来,我不想在没有更好地了解正在发生的事情的情况下开始挖掘 Cmake 文件。任何指导将不胜感激。如果我可以提供任何其他信息,请告诉我。

【问题讨论】:

    标签: cmake g++ cygwin clion


    【解决方案1】:

    事实证明,cmake、make 和 g++ 软件包已安装但未更新到最新版本。重新运行 cygwin 安装程序解决了我的问题,现在一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-03
      • 1970-01-01
      • 2016-02-18
      相关资源
      最近更新 更多