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.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Doing for User Space What We Did for Kernel Space
- Tech Tip: Really Simple HTTP Server with Python
- SuperTuxKart 0.9.2 Released
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
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