CMake complains: "CXX compiler id unknown"

I am following this topic and one to create my own KDE without sudo permission. Since the workstation did not have Git and CMake. I just installed both of them under / home / <user> and added / home / <user> / bin and / home / <user> / lib for both PATH and LD_LIBRARY_PATH. Since the KDE assembly only supports CMake, it is not configurable. Therefore, I must set the prefix via CMake, for example: cmake ~/kde-devel/src/kdelibs -DCMAKE_INSTALL_PREFIX=/home/<user> . At this point, I received the error below:

 > ~/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" ... 

I checked that there are 2 C ++ compilers:

 > where c++ /home/gnu/bin/c++ /usr/bin/c++ 

Should I install the default C ++ Cake compiler on /usr/bin/c++ ? And How? Or is there a way to fix this problem?

+8
linux cmake
Mar 14 2018-12-12T00:
source share
3 answers

It seems that your /home/gnu/bin/c++ requires an additional flag to correctly refer to things, and CMake is not aware of this.

Use /usr/bin/c++ as your cmake compiler with -DCMAKE_CXX_COMPILER=/usr/bin/c++ .

In addition, the CMAKE_PREFIX_PATH variable sets the destination directory where the project files should be installed. It has nothing to do with the CMake installation prefix, and CMake itself already knows this.

+11
Mar 14 2018-12-12T00:
source share

Run apt-get install build-essential on your system.

This package depends on other packages that are considered necessary for assembly and will install them. If you find that you need to create packages, this can be useful to avoid phasing out dependencies.

See this page for more details.

+14
Dec 17 '15 at
source share

I just had a problem setting up my new laptop. The problem for me was that my tool chain (CodeSourcery) has 32-bit, and I did not install 32-bit libraries.

 sudo apt-get install ia32-libs 
+2
Aug 22 '13 at 14:14
source share



All Articles