Hi,
I have just opened the Kdevelop interface to make my first C++ program. I think all I need to do first of all is click on the Project menu and then select New Project. Then click on the All Projects tab. This shows two options C and C++. So selectd C++ and it expanded giving more options underneath it such as CMake Based Project, Embedded, GTK, KDE, Kdevelop, QMake Project, wxWidgets. I selectd the QMake Project option and it expanded giving some more options underneath such as Simple ClanLib Application, Simple Hello World Program, Simple ncurses Hello World Program etc. I chose "Simple Hello World Program". Then I gave an application name like "first" and location of the file. As soon as I did this a new program called main.cpp was automatically written by Kdevelop and when I tried to execute it, a dialog box came with a message saying "There is no Makefile in this directory and no configure script for this project. Run automake and friends and configure first?" I clicked on "Run them" and a new windows opened with an output of the main.cpp file with the following message:
Hello World.
Press enter to continue...
I did so and closed down the Kdevelop ide. Then I restarted the IDE and clicked on File menu and chose New and created a new file with a name "two" and added the following code into it.
#include <iostream>
using namespace std;
int main() // Most important part of the program!
{
int age; // Need a variable...
cout<<"Please input your age: "; // Asks for age
cin>> age; // The input is put in age
cin.ignore(); // Throw away enter
if ( age < 100 ) { // If the age is less than 100
cout<<"You are pretty young!\n"; // Just to show you it works...
}
else if ( age == 100 ) { // I use else just to show an example
cout<<"You are old\n"; // Just to show you it works...
}
else {
cout<<"You are really old\n"; // Executed if no other statement is
}
cin.get();
}
Saved it and clicked on "Execute program" button, the gearlike symbol, but to my surprise it did not give me the output it should have instead gave me the output of the previous main.cpp file as follows:
Hello World.
Press enter to continue...
Now can any one please tell me what to do? How can I make new files in this same project and execute them properly. This is driving me nuts, can't understand what is going wrong here. Thanks.