Registered Member
|
so i have been reading accelerated c++ practical programming and i opened kdevelop to make the framed greeting that is in the book as a practice c++ program and this is what i type
// say what standard-library names we use using std::cin; using std::endl; using std::cout; using std::string; int main() { // ask for the person's name cout << "Please enter your first name: "; // read the name string name; cin >> name; // build the message that we intend to write const string greeting = "Hello, " + name + "!"; // the number of blanks surrounding the greeting const int pad = 1; // the number of rows and columns to write const int rows = pad * 2 + 3; const string::size_type cols = greeting.size() + pad * 2 + 2; // write a blank line to separate the output from the input cout << endl; // write `rows' rows of output // invariant: we have written `r' rows so far for (int r = 0; r != rows; ++r) { string::size_type c = 0; // invariant: we have written `c' characters so far in the current row while (c != cols) { // is it time to write the greeting? if (r == pad + 1 && c == pad + 1) { cout << greeting; c += greeting.size(); } else { // are we on the border? if (r == 0 || r == rows - 1 || c == 0 || c == cols - 1) cout << "*"; else cout << " "; ++c; } } cout << endl; } return 0; } and i get this error when i try to build it /home/nate/projects/framed greeting/build> /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local '/home/nate/projects/framed greeting/' CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_greeting_COMPILER_ENV_VAR CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_greeting_COMPILER CMake Error: Could not find cmake module file:/home/nate/projects/framed greeting/build/CMakeFiles/2.8.11.2/CMakegreetingCompiler.cmake CMake Error: Could not find cmake module file:CMakegreetingInformation.cmake CMake Error: CMAKE_greeting_COMPILER not set, after EnableLanguage CMake Error at CMakeLists.txt:5 (install): install TARGETS given target "greeting" which does not exist in this directory. CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as cmake_minimum_required(VERSION 2. 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! *** Failure: Exit code 1 *** please help, i am not sure if it is a cmake or kdevelop issue, but i have re-installed cmake and kdevelop and i made sure i have all the libraries and ect..... |
Global Moderator
|
To determine that, run cmake from command line exactly as kdevelop does. If you get the same error (which is what I suspect) it's a problem with your setup; if it works there, KDevelop is at fault.
Greetings, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
thanks scummos for the reply, assuming i did it properly this is the result of running cmake via the konsole
root:/home/nate/projects # cmake framed greeting CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as cmake_minimum_required(VERSION 2. 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 done -- Generating done -- Build files have been written to: /home/nate/projects so i am assuming that i have an issue with kdevelop since i didnt get an error with cmake in the konsole |
Global Moderator
|
Try running exactly what KDevelop runs ( /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local '/home/nate/projects/framed greeting/' ).
Does that fail too?
I'm working on the KDevelop IDE.
|
Registered Member
|
i tried running it that way and this is what i got
/home/nate/projects/framed greeting/build> /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local '/home/nate/projects/framed greeting/' *** Failure: /usr/bin/cmake has failed to start *** |
Global Moderator
|
|
Registered Member
|
i typed it into the konsole and that was the error message i got,
and this is what i got when i cnf cmake, it does show that is installed root:/home/nate # cnf cmake Program 'cmake' is present in package 'cmake', which is installed on your system. Absolute path to 'cmake' is '/usr/bin/cmake'. Please check your $PATH variable to see whether it contains the mentioned path. i think my system is a little buggy, going to re-install cmake and kdevelop and see if that fixes the problem. |
Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]