How to set up headers and libraries for Linux development

I recently installed the Ubuntu desktop PC with KDE 4.2 for the training exercise, installed Eclipse, and started looking for information on how to develop KDE. I know KDevelop and will probably look at it in the future. However, right now I do not have the correct headers and libraries for building KDE applications in C / C ++ using Eclipse. If I have the following:

#include <kapplication.h> 

it will not compile, because there are dependencies on other header files that are not on my hard drive or reference classes that are not declared anywhere.

So the question is, what packages do I need to install in order to have the correct set of headers so that I can write applications for KDE 4.2? Are there any packages I don't need? Otherwise, if there are no packages, then where can I get the corresponding files?

As a result, are there any good KDE tutorials, something like a Windows Petzold book?

EDIT: An explanation of what I really need: where can I download the correct set of header files / libraries to create a KDE application? IDEs for compiling code are not a real problem and are easy to get, and they also configure compiler options to include search paths, etc. Does KDevelop have all the correct include and library files, or are they separated? I assume they are separate, since KDevelop is a development environment that can also run other languages, but I'm probably wrong. So the KDE / Qt header files that I have do not work, where can I get the ones I need?

Skizz

+6
c ++ eclipse linux ubuntu kde
source share
8 answers

make sure you install the assembly of the required package. For more documentation available from the command line, install glibc-doc, manpages-dev, gcc - * - doc, libstdC ++ * - doc (replace "*" with the appropriate version numbers for your system)

EDIT: I'm going to accept this, but with a few extra bits.

Firstly, this page contained a couple of โ€œsudo aptitude installโ€ which I command, which I used to get some necessary packages. I also got the KDevelop and QDevelop apps, although I'm not sure if they are required. There was another package I needed: "kdelibs5-dev", and this one seems to be the key package. After that, it was all over. Eclipse and KDevelop were happy to create a simple application after setting compiler options - just the search paths and library file names for Eclipse.

Eclipse is better from first impressions than KDevelop, for the reason that the tool windows in Eclipse can be disconnected from the main window and the float is useful when setting up with two monitors. I could not do it anyway in KDevelop (I'm sure someone will comment on how to do this).

+6
source share

You may have some idea of โ€‹โ€‹what is included in your .classpath and .project files if you look and see the CMake content used to develop the application for KDE4.2

I believe that the development section of my KDE site is pretty complete when it comes to explaining their development environment.
alt text http://techbase.kde.org/images/thumb/2/25/Action_configure.svg/40px-Action_configure.svg.png , especially their Programming Section .

+2
source share

To get all the dependencies needed to build an application on Debian (and supposedly Ubuntu), use "apt-get build-dep". So, choose a random KDE application - casteroids? - and run:

 apt-get build-dep kasteroids 

No need to guess what tools and libraries you need to create a KDE application.

+2
source share

If Eclipse does not provide you with any setup wizard / initial project for the KDE program, I would recommend that you install kdevelop and run such a project there (just write a little Hello World). You can then look at the generated files and follow the build process to better understand and possibly transfer them to Eclipse.

Even if you disable compiler flags for the correct directories included, etc., and it works, you should consider using one of the common ways to create your software (e.g. qmake for QT, cmake? For KDE ..). If you start using them right now, deploying / distributing your software will be easy.

+1
source share

check pkg-config.

For example, you can see the libraries installed by polling:

 pkg-config --list-all 

For example, to find flag compilations of the gdk library:

 ~$ pkg-config --cflags gdk -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include ~$ 

In the end, you will contact the library, and you will also need libraries:

 ~$ pkg-config --libs gdk -lgdk -lXi -lXext -lX11 -lm -lglib ~$ 

Note. For this, you will need development libraries to do this.

+1
source share

I can add some useful advice if you notice that you are missing a file and want to know which package it provides. Install the apt file, then you can run the file name of the search apt file to find out the package containing this file. Please note that you need to start updating the apt file to get the latest information.

+1
source share

Eclipse is much better than Kdevelop, but Eclipse does not support Kde application development. If you want to develop an application for KDE, you should go to Kdevelop. If you use Qt not kde libraries, than using Qt Eclipse QtCreator is another good option for developing Qt applications.

0
source share

I used KDevelop4 for a while, and it was great. KDevelop3 is heavy and has signs of bitrate (using 300 MB of RAM with one project per 50 km). I have KDevelop4 (since the beta was launched recently), and ~ 100 MB of RAM (the same project) is required, and contextual highlighting, excellent completion and other positive effects make it difficult to return to the "boring" outdated syntax backlight. I do not know if the experimental versions have any builds, but with the number of packages that are there, I would be almost surprised if they did not have Debian. In addition, all toolbars can be detached in all KDE4 applications, so KDevelop4 also has.

0
source share

All Articles