I am having multi-version of GCC in ubuntu, gcc-4.8
and gcc-5
. Using gcc -v
will gives gcc version 4.8.4
, so looks like the default is 4.8, but I need to use the gcc-5
.
I tried How to specify new GCC path for CMake:
export CC=/usr/bin/gcc-5
export CXX=/usr/bin/g++-5
// find the path by using 'which gcc-5'
and specific:
-DCMAKE_C_COMPILER=/usr/bin/gcc-5
-DCMAKE_CXX_COMPILER=/usr/bin/g++-5
but gives an error:
ubuntu@skc:~/jumanpp-2.0.0-rc2/bld$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/Jumanpp -DCMAKE_C_COMPILER=/usr/bin/gcc-5 -DCMAKE_CXX_COMPILER=/usr/bin/g++-5
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/gcc-5
-- Check for working C compiler: /usr/bin/gcc-5 -- broken
CMake Error at /usr/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/gcc-5" is not able to compile a simple test
program.