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

Writing Apps for KDE

Tags: None
(comma "," separated)
bgravelston
Registered Member
Posts
4
Karma
0
OS

Writing Apps for KDE

Mon Mar 24, 2014 9:47 pm
I would like to learn how to write my own applications for KDE. I have started looking at the tutorials at http://techbase.kde.org/Development/Tutorials to get started. I am using KDE 4.9.5 on Linux Mint 14, which is up-to-date as of 3-24-2014. Aside from installing the Code::Blocks IDE (currently version 10.05), gcc, and cmake (both of which are up-to-date), I have made no preparations for developing KDE apps.

I have used this setup to successfully write console apps, but now that I am trying to write KDE apps I have run into a problem. While trying to compile the first tutorial listed on the site mentioned above (http://techbase.kde.org/Development/Tut ... st_program), the compiler gave me the error "KApplication: no such file or directory." I suspect that the cause of this is that a path variable is not set properly or that the file (or, more likely, the entire KDE-specific library) simply doesn't exist on my computer. However, I do not know which path variable this would be or where to look for the supposedly missing files, so I do not know which it is.

Could somebody please tell me how to fix this, and what else I might need to install or set up to develop KDE apps? I have briefly looked at http://techbase.kde.org/Getting_Started ... nvironment, but I do not know how much this applies to me, since I am trying to build my own apps, not KDE itself. I have tried adding the ".bashrc" script found about two thirds down the page to my .bashrc file, but this had no effect (I did log out then start a new session).

I understand the basics of C++ programming but I am still very much in the learning stage. I have no experience in writing GUI applications for any platform. I have a general understanding of the structure of the Linux directory tree, and I feel comfortable using the Linux terminal. I have no knowledge of the technical workings of the KDE platform.

Thank you,
Bill
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Writing Apps for KDE

Mon Mar 24, 2014 10:52 pm
Hi!

Welcome to KDE ;)

Are you sure you installed the kdelibs-dev (or similar) package? That usually contains the headers you seem to be missing.

Greetings,
Sven


I'm working on the KDevelop IDE.
bgravelston
Registered Member
Posts
4
Karma
0
OS

Re: Writing Apps for KDE

Tue Mar 25, 2014 7:58 pm
Thank you, Sven. I was missing the package kdelibs5-dev. That package was mentioned in the tutorial, but I could not find it because I did not know exactly what it was called.

The files are now installed in the "KDE" subdirectory of /usr/include, where all of the include files I have used up to this point have been stored. Then in Code::Blocks I went to Settings >> Compiler and Debugger >> Compiler and Debugger Settings >> Search Directories and added the necessary directories to the list. Code::Blocks can now find all of the files, and it should not be too difficult to add any new files I might need, now that I know where they are located and which settings to change.

Unfortunately, it seems that Code::Blocks is unable to compile the code for KDE applications. This is slightly inconvenient, but I was able to get the first two tutorial programs working by following the steps to use cmake found in the tutorial.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Writing Apps for KDE

Tue Mar 25, 2014 9:23 pm
It's always CMake compiling your application, no matter what. Some IDEs support cmake (e.g. KDevelop), for those who don't it will probably be a bit inconvenient. Although you'll probably be fine if you can get it to just run make in your build directory.

Greetings,
Sven


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot]