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

前端 未结 2 1365
失恋的感觉
失恋的感觉 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.

提交回复
热议问题