Compiling with Kdevelop
Hi, i installed Kdevelop on ubuntu. And when i try to execute my program called 'test', i get these errors:
Quote:
Quote:
I have never programmed in linux before and dont know why the hell it's so complicated, isnt there an IDE which I can just press something like CTRL+F9 and the program runs, like in windows? |
KDevelop is such an IDE. Have you installed libtools? It is essential to KDevelop, otherwise strange errors occur.
What sort of program are you trying to write? If its a console app then most of those headers wont be needed, but if you want to use KDE libraries or the locale settings then you will need them. I take it you are fairly well versed in C++ on Windows machines? |
Quote:
|
Quote:
Code:
Couldn't find any package whose name or description matched "libtools" Quote:
Code:
#include <stdio.h> Quote:
Quote:
I really appreciate your help, and ill be happy if you can make this whole thing clearer to me. |
KDevelop helps to manage the projects for you. When you create a new project it will insert some dummy code for you which you van use a the basis of your program. It looks as if you have selected the "Simple KDE Application" This project has generated quite a few files.
To find what has been generated for you, go to the file tree and open the src folder. There will be nine files there are two *.cpp and one *.h There are others files that manage the user interface, icons etc. The file that you wanted to change is really the main.cpp (but it opens with the test.cpp) However the better project to select from the (dauntingly long) list is "Simple Hello World Program" When you select a project you will find it under the C++ directory. However if it is not visible just click on the show all project templates. This project will give you a simple (single file) pure C++ project. Have fun. |
Ok i went with "Simple Hello World Program" and i managed to run my program, but, can i add more files to this project? i tried to add a simple function in other file called 'second' which i inserted into the project, but when i ran the program i got errors, i tried to include a header file (.h) with the declaration of the function but it still didnt work. However when i insert the definition of the function (i.e the whole function) into the header file it does work.
Is it me doing something wrong or is it the project can handle just one file? Here is the error i get: Quote:
|
Ok i went with "Simple Hello World Program" and i managed to run my program, but, can i add more files to this project? i tried to add a simple function in other file called 'second' which i inserted into the project, but when i ran the program i got errors, i tried to include a header file (.h) with the declaration of the function but it still didnt work. However when i insert the definition of the function (i.e the whole function) into the header file it does work.
Is it me doing something wrong or is it the project can handle just one file? Here is the error i get: Quote:
|
Sorry for not replying earlier, I've been on the road for the last week, finally arrived home...
Yes you can add file to the project, (I've not actually got my Linux box on at the moment so I can't check the actual steps) The trick is to add the new file to the project. On the right panel there should be a project tab you can use this to add a file to the project. Behind the scenes the project is managed by make as so the new file is added to the list of files make needs to manage. |
All times are GMT -5. The time now is 01:34 PM. |