Ubuntu – Qt build in Ubuntu 12.04

12.04qt

I have installed Qt Creator 2.7.2 'Based on Qt 5 1.0 (32 bit)'. First I have tried its example analogclock, but its building does not find a command g++, while I have installed the gcc compiler. See the listing

  
07:50:44: Running steps for project analogclock...  
07:50:44: Starting: "/home/tatatom/Qt/5.1.0/gcc/bin/qmake" /home/tatatom/Qt/5.1.0/gcc/examples/gui/analogclock/analogclock.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug  
07:50:45: The process "/home/tatatom/Qt/5.1.0/gcc/bin/qmake" exited normally.  
07:50:45: Starting: "/usr/bin/make"   
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../../../mkspecs/linux-g++ -I../analogclock -I../rasterwindow -I../../../include -I../../../include/QtGui -I../../../include/QtCore -I. -I. -o rasterwindow.o ../rasterwindow/rasterwindow.cpp  
make: g++: Command not found  
make: *** [rasterwindow.o] Error 127  
07:50:45: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project analogclock (kit: Desktop Qt 5.1.0 GCC 32bit)
When executing step 'Make'  
07:50:45: Elapsed time: 00:01.  

I apparently need something more to install or configure: an attempt to build downloaded kaffeine stated "CMAKE_CXX_COMPILER-NOTFOUND", see the listing

tatatom@Katedrala:~$ cmake kaffeine-1.2.2  
-- The C compiler identification is GNU  
-- The CXX compiler identification is unknown  
-- Check for working C compiler: /usr/bin/gcc  
-- Check for working C compiler: /usr/bin/gcc -- works  
-- Detecting C compiler ABI info  
-- Detecting C compiler ABI info - done  
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.  
CMake Error at /usr/share/cmake-2.8/Modules/FindKDE4.cmake:98 (MESSAGE):  
  ERROR: cmake/modules/FindKDE4Internal.cmake not found in 
  /home/tatatom/.kde/share/apps;/usr/share/kde4/apps
Call Stack (most recent call first):  
  CMakeLists.txt:3 (find_package) 

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as
    cmake_minimum_required(VERSION 2.8)
  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

Please advise me. Thanks.

Best Answer

All you need to do is open up a terminal and run sudo apt-get install build-essential -y and you will be set, you are missing the build tools.

Related Question