This forum has been archived. All content is frozen. Please use KDE Discuss instead.

cmake mak gcc Kdevelop, what else?

Tags: None
(comma "," separated)
wotan
Registered Member
Posts
131
Karma
-2
OS

cmake mak gcc Kdevelop, what else?

Tue Mar 20, 2012 12:28 am
1)install cmake
2)install make
3)install gcc
4)instal kdevelop
5) create new project (helloworld in terminal)


CMakeLists.txt
Code: Select all
project(hello_world_terminal)
add_executable(hello_world_terminal main.cpp)


main.cpp
Code: Select all
#include <iostream>

int main(int argc, char **argv) {
    std::cout << "Hello, world!" << std::endl;
    return 0;
}


Output
Code: Select all
/home/max/Documents/C/Projets/Hello_world_terminal/build> make
make: *** No targets specified and no makefile found.  Stop.
*** Fehlgeschlagen ***


Whats wrong with it ?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Did you run "cmake ." prior to attempting to run "make"?
Also, CMake is usually run in a seperate build/ directory as so:
Code: Select all
cd /path/to/build/dir
cmake /path/to/src/dir/


You should then be able to run make.
With a CMake based project KDevelop should take care of running CMake though.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
wotan
Registered Member
Posts
131
Karma
-2
OS
Yeah I did:
Code: Select all
max@netbook:~/Documents/C/Projets$ cmake ./Hello_world_terminal/
-- The CXX compiler identification is unknown
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!


I don't understand why all those variable are not automitcally configured at the installation.. I have a standard installation I did not change anything...
peje
Registered Member
Posts
9
Karma
0
OS
It seems like you don't have a c++ compiler. On debian and, I belive, on ubuntu/kubuntu the c++ compiler is a separate package from gcc so it needs to be installed explicitly.
wotan
Registered Member
Posts
131
Karma
-2
OS
Oohh man thats right! I need g++

Code: Select all
sudo apt-get install g++


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell