CMake “clang++ is not able compile a simple test program” (Fedora 20)

前端 未结 2 1338
失恋的感觉
失恋的感觉 2021-01-18 04:18

So I tried to install clang + cmake to compile a simple C++ program and I\'m getting the following error:

-- The C compiler identification is GNU 4.8.3
-- Th         


        
相关标签:
2条回答
  • 2021-01-18 04:50

    Your /home/gnu/bin/c++ seem to require additional flag to link things properly and CMake doesn't know about that.

    To use /usr/bin/c++ as your compiler run cmake with -DCMAKE_CXX_COMPILER=/usr/bin/c++.

    Also, CMAKE_PREFIX_PATH variable sets destination dir where your project' files should be installed. It has nothing to do with CMake installation prefix and CMake itself already know this.

    0 讨论(0)
  • 2021-01-18 05:09

    You need the development libraries and headers for C++ library, try

    yum install libstdc++-devel
    
    0 讨论(0)
提交回复
热议问题