Developing C/C++ Applications with the KDevelop IDE
The aim of this article is to enable you to create an application with the KDevelop Integrated Development Environment (IDE) on a Linux/UNIX system running KDE 2. We explain this process by creating a sample application that gives some insight into the development framework and how it works. This might require getting your development environment set up correctly, so that you can work efficiently when getting started with your very own application or extension for the KDE 2 Desktop.
An IDE provides the user with a complete set of tools that integrate into one graphical environment. It's an enormous bonus for developers if the environment remains flexible enough to handle things separately or outside of the IDE, so they are not forced to use the IDE's features where they think other tools are more appropriate.
Although IDEs on other platforms, especially on Microsoft operating systems, come with all the tools bundled into one package, it's very different on a UNIX system. With UNIX, the compiler, which is needed to create applications from the programming code that can be run on a machine, is part of the operating system. Various tools that can be used in conjunction with the compiler, like make or the GNU tools, are delivered as separate packages, and an IDE makes use of these tools internally.
The KDE Project, comes with an IDE called KDevelop. This IDE can be used on any UNIX system to develop software, especially KDE software, but not limited to it. Many experienced UNIX programmers use it for plain C and C++ programming.
If you're using a popular Linux distribution, you should encounter few problems when setting up the IDE; especially when it already ships with KDevelop and takes over the installation of all the tools needed. What you need, in any case, is a C/C++ compiler, such as the current version of gcc that ships with current distros.
The next task is installing the GNU tools autoconf and automake and the package-building utility make.
For finding program errors, you need to install a debugger installed, which is called gdb, the GNU debugger. To complete your environment, the version control management utility, CVS, can be helpful, as well as source code documentation software, such as kdoc and doxygen.
The last package you need is KDevelop itself; it can be downloaded from the KDE web site at www.kde.org or from your distribution's web site.
If these requirements are all met, you still might be missing at least one very important part of your development environment, especially for KDE programming: the header files of the libraries that you intend to use. These files contain the API (application programming interface) that the compiler needs to have in order to look up which functionality you want to use while compiling your application.
The header files (also known as include files) should be located in your $KDEDIR/include (KDE header files) and your $QTDIR/include (Qt header files) directories. Make sure you have these installed; usually they're in packages with names such as kde-devel and qt-devel.
Further, there is the Qt Designer, a graphical user interface builder that is easy to use and works together with KDevelop to create KDE/Qt applications, so make sure that you have it installed as well.
Note: the KDEDIR and QTDIR environment variables should point to the directories where your KDE 2 and Qt 2.x installations are located, e.g., in your ~/.bashrc: export KDEDIR=/opt/kde2; export QTDIR=/usr/lib/qt-2.3.0.
As a programming beginner, it is crucial to have a successful experience. Let's start with creating your first KDE application. Open up KDevelop and make yourself comfortable with the environment.
In the treeview on the left side, you should see some books that you can unfold and that contain documentation included with KDevelop--almost 500 pages that can help you in almost every development situation. The second folder in that tree contains books with the API documentation of the Qt and KDE libraries.
In case you don't see them, set the appropriate paths in KDevelop through Options-->KDevelop Setup in the Documentation section. The other windows in the treeview will be used during development, and we will refer to them later. The right-hand window contains three tabs: two editor windows and a browser window, which will display the HTML documentation you select on the left treeview (see Figure 1).
The window on the bottom will be used to inform you about what your environment is currently doing; it will show the compiler output later on and display any error messages.
|Happy Birthday Linux||Aug 25, 2016|
|ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs||Aug 24, 2016|
|Updates from LinuxCon and ContainerCon, Toronto, August 2016||Aug 23, 2016|
|NVMe over Fabrics Support Coming to the Linux 4.8 Kernel||Aug 22, 2016|
|What I Wish I’d Known When I Was an Embedded Linux Newbie||Aug 18, 2016|
|Pandas||Aug 17, 2016|
- Happy Birthday Linux
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs
- What I Wish I’d Known When I Was an Embedded Linux Newbie
- Updates from LinuxCon and ContainerCon, Toronto, August 2016
- New Version of GParted
- NVMe over Fabrics Support Coming to the Linux 4.8 Kernel
- All about printf
- Tor 0.2.8.6 Is Released
- Tech Tip: Really Simple HTTP Server with Python
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide