problem with g++ and CXX in Cmake

Issues related to applications and software problems
Post Reply
crwatts
Posts: 4
Joined: 2014/07/08 19:41:43

problem with g++ and CXX in Cmake

Post by crwatts » 2015/07/26 17:50:52

I am trying to compile a pice of software using Cmake and get the following error. I have checked using yum to make sure that gcc. gcc-c++ and ncurses are all installed and up to date. Any ideas?

-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error at CMakeLists.txt:5 (project):
The CMAKE_CXX_COMPILER:

g++44

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!

crwatts
Posts: 4
Joined: 2014/07/08 19:41:43

Re: problem with g++ and CXX in Cmake

Post by crwatts » 2015/07/26 17:54:56

sorry, one other pievce of info. This is the bootstrap shell.

Code: Select all

if [ $(uname) == 'Linux' ]
then
if [ -e /etc/gentoo-release ]
then
	export LDFLAGS="-nopie"
elif [ -e /etc/redhat-release ]
then
	CMAKE_DEFS="-DCMAKE_CXX_COMPILER=g++44"
fi
elif [ $(uname) == 'Darwin' ]
then
	# sudo ports install gcc44
	CMAKE_DEFS="-DCMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-4.4"
fi
CMAKE_DEFS="-DCMAKE_INSTALL_PREFIX=${PWD} $CMAKE_DEFS"
if [ $# == 1 ]
then
	case $1 in
	'debug')
		CMAKE_DEFS="-DCMAKE_BUILD_TYPE=Debug $CMAKE_DEFS"
		;;
	'release')
		CMAKE_DEFS="-DCMAKE_BUILD_TYPE=Release $CMAKE_DEFS"
		;;
	'static')
		CMAKE_DEFS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS=-static $CMAKE_DEFS"
		;;	
	esac
fi

rm -rf build

mkdir build

cd build && cmake .. ${CMAKE_DEFS}
[Moderator edited to insert code tags so as to preserve formatting.]

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: problem with g++ and CXX in Cmake

Post by TrevorH » 2015/07/26 17:56:31

The g++ compiler on CentOS 6 is just called g++ not g++44. Your script is setting the wrong value, it seems to think it's on CentOS 5 where the default compiler is 4.1.2 and the 4.4.7 compiler is an optional parallel install called g++44.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

crwatts
Posts: 4
Joined: 2014/07/08 19:41:43

Re: problem with g++ and CXX in Cmake

Post by crwatts » 2015/07/26 18:19:58

problem solved, there is an error in the bootstrap file.

Post Reply