我正在關注此thread和此one未建立sudo權限來構建我自己的KDE。由於工作站上沒有安裝Git和CMake。我只是他們兩個下/家庭/ <用戶>安裝並添加/家庭/ <用戶>/bin中和/家庭/ <用戶>/lib目錄既PATH和LD_LIBRARY_PATH。 由於KDE構建只支持CMake,因此不需要配置。所以我必須通過CMake設置前綴,如下所示:cmake ~/kde-devel/src/kdelibs -DCMAKE_INSTALL_PREFIX=/home/<user>
。在這一點上我得到了以下錯誤:CMake抱怨「CXX編譯器標識未知」
> ~/bin/cmake ~/kde-devel/src/kdelibs -DCMAKE_INSTALL_PREFIX=/home/<user>
-- The CXX compiler identification is unknown
-- Check for working CXX compiler: /home/gnu/bin/c++
-- Check for working CXX compiler: /home/gnu/bin/c++ -- broken
CMake Error at /home/<user>/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:45 (MESSAGE):
The C++ compiler "/home/gnu/bin/c++" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /home/<user>/kde-devel/build/kdelibs/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
...
我查了一下,有2個C++編譯器:
> where c++
/home/gnu/bin/c++
/usr/bin/c++
我應該設置CMake的默認C++編譯器?如何?或者有什麼辦法解決這個問題?
'-DCMAKE_CXX_COMPILER =/usr/bin/c +'+在windows 10 bash shell上解決了我的問題。我在爲WebAssembly安裝'Emscripten'時遇到了這個問題 – TechMaze 2017-08-04 05:50:39