Inspired by my previous post on using Qt Creator on non-Qt SDK projects, I went a step further and integrated the Linux Man Pages section 2(system calls) and section 3(library functions) as a context help module in Qt Creator and Qt Assistant. Having documentation on all of the Linux system calls and system libraries at one click away(F1) is a great advantage and boost to productivity when doing system programming on Linux(and not only), especially now that Linux has around 400 system calls and GlibC 1400 functions.
The Man pages have been bundled as a Qt Compiled Help module that is easily plugged into Qt Creator or Qt Assistant. The HTML pages used are the official ones available at kernel.org, the online version. I have removed the Google search and StatCounter Code since they are not necessary for this purpose.
The manpages are accessible by context help, when pressing F1 on a declared function like select or printf or by visiting the Help screen and browsing them alphabetically or by searching the index. You can find more information about them right there in the Help screen in the Linux Man pages category.
You can download a gzipped version Qt Compiled Help Linux Manpages from here:
Using it is pretty straight straight forward, open up Qt Creator and go to Tools -> Options -> Help screen. Switch over to the Documentation tab and then click on Add, like so:
Browse to your gunzipped manpages.qch location and click Open. You should now see an entry named org.kernel.manpages.1.0 that points to your supplied location:
Remember that if you remove or move the .qch to another location Qt Creator will not be able to find it anymore, since it doesn’t create a copy for itself. It’s best if you put in a place that makes sense in this manner.
If i see demand for this module, I’ll move the instructions on how to import the Linux man pages Qt Compiled Help module, as well as download links, to the main site(shinnok.com) and I will try and update them every so often once I hear of important changes to the man pages. Till then, this will be a blog simple post.
[Update1 20-07-2011] As per numerous requests, the games list has been updated with some more cool games that I’ve missed. They have been prepended to the top of the list and as before, they are in no particular order.
While the popular conception when it comes to games for Linux is that they are almost non-existent, this is only true when it comes to big and popular commercial franchises that are backed up by giant video game studios and publishers like EA Games, Blizzard and Konami. On the other hand, Linux(and other platforms like *BSD) benefits from a myriad of open source and free games, some smaller for casual gaming and others more impressive like MMORPG’s and FPS’s that could compete with some of the commercial games out there in their branch either in the current state or given some fresh amount of contribution. Open source games are a convoluted topic and are somewhat special and unlike a traditional Open Source project because they require much more then code contribution, which foss minded hackers and geeks are eager to contribute anytime during the day. The three major issues with open source games that are apart from a traditional open source project are:
1. Harder to steer and govern – Traditional open source projects usually have a specific purpose and use case, thus there’s not much to argue about why and if a specific tool should do what it does. At most there is a how attached to it, like how to best implement that specific functionality or how to interact with the user better. When it comes to games there’s game behavior and mechanics that are to be settled upon, these are complex and intricate issues that involve ethics, human emotions, economy, public perception and many more aspects that given a set of 10 people to decide upon you’re most likely to come up with 5 different solutions and opinions then a single one. Some open source games have suffered from this and more will in future, because these issues pertain to human aspects and perception rather then technical ones.
There’s not much to argue about whether the best algorithm should be used over an existing crappy implementation, but there’s lots to argue about whether a character class should be more powerful then another or if health and mana potions should be acquirable at the market or at all. In these cases, a more Nazzi, restrained and centralized government would have worked better then the open one as well as more defined game behavior and mechanic in the first place.
So if you’re the master of an open source game, stop paying attention to each and every comment and complaint on the forums and irc channels or even better, stop putting to heart every single argument you stumble upon, you’re doing a great job and you know it, have a plan and stick to it. Ignoring useless flames and rants and random people telling you what to do or what your game should be like is not the right path to take in this case. Of course you should not be an ass(2,3) or take this advice to the extreme since that will hurt your project even more than doing good or even put you in danger of sporks.
2. Games are multifaceted productions – that involve game design, graphic design, media and 3D content, story telling, script planning and development, besides the usual code. When it comes to games, code is not the problem, content is. There are lots of hackers willing to throw some code at a cool open source project, however, there aren’t that many game designers or graphics designers that are willing to contribute in their free time just because it’s fun or intriguing. Just not long ago, the only open source or royalty free media that you could get your hands on were icon packs and wallpapers.
Thus if it happens that your a game designer, graphic designer, media creator or story and script planner and you’re complaining about the lack of games on the Linux platform, remember that you can change that, with minor chunks of your free time applied to the right Open Source game or at least apply to a game studio that ships cross platform games. Stop complaining, take action.
3. Most games nowadays require some form of online interaction – be it either for ranking and competing or multi-player gaming or availability, single player games are not that fun anymore. You have to have some form of online or social interaction within the game for it to last. Zelda, Doom and Duke3D were cool and fun as long as there were no real alternatives. As soon as you get World of Warcraft, Starcraft and Halo you’ll never look back until melancholy for old times and old school strikes. So what does this online interaction involve? Well it involves data storage, bandwidth, servers, maintenance and web development. These resources don’t come free in anyway, form or shape and they mostly cost money. The guy working on the C/C++ core engine of the game or the shaders/3D guy isn’t likely(or have time) to maintain a web server or do web development either. You need donations for the hardware and network part as well as contribution for maintenance and web development.
If you’re the CEO or have influence over a hosting or isp company you could help Open Source Gaming by donating resources to those games that need it. If you’re a web developer, designer or sysadmin you can help in building and maintaining the infrastructure that a multiplayer game needs.
So that’s what I think about Open Source Games and why they are a special breed and also tried to appeal to those that could help in changing history and the status quo. Open source games are fun and addictive to contribute to and you should give it a try, be it either code or game content. That’s why I’m going to list some of the coolest and/or popular Open Source games out there to help you make your mind as well as prove to you that, yes, there are great Open Source games:
Xonotic is a free (GPL), fast-paced first-person shooter that works on Microsoft Windows, Mac OSX and Linux. Xonotic is a direct successor of the Nexuiz Project. Xonotic places focus on community involvement as its principal driving force and structures itself to respect that. The aim of Xonotic is to become the best possible open-source FPS (first-person-shooter) of its kind.
- More screenshots: http://www.xonotic.org/media/xonotic-screenshots/
- Homepage: http://www.xonotic.org/
- Source Code: http://dev.xonotic.org/projects/xonotic/wiki/Repository_Access (QuakeC)
Zero Ballistics is a unique blend of multiplayer first person shooter and tank combat game. Easy to learn, difficult to master was our mantra during the development of the game. Set in lush alpine environments covering all seasons, playing Zero Ballistics is as thrilling as it is relaxing.
- More screenshots: http://www.zeroballistics.com/screenshots.php
- Homepage: http://www.zeroballistics.com/
- Source Code: http://sourceforge.net/projects/zeroballistics/ (C++)
Speed Dreams is a 3d cross-platform, open source motorsport simulation and racing game. It is released under the GNU General Public License (GPL). Speed Dreams is a fork of the open racing car simulator Torcs, aiming to implement exciting new features, cars, tracks and AI opponents to make a more enjoyable game for the player, as well as constantly improving visual and physics realism.
- More screenshots: http://www.speed-dreams.org/#media
- Homepage: http://www.speed-dreams.org/
- Source Code: http://sourceforge.net/projects/speed-dreams/ (C++)
Freedroid RPG is an RPG with isometric graphics. In it, the player is Tux, who must fight rebelling robots in order to restore peace to humankind. To do so, Tux may take over robots in a minigame based off the classic game Paradroid, or may simply blast them to pieces with a weapon.
S.C.O.U.R.G.E. 2 is a cross platform, open source rogue-like game in the fine tradition of NetHack and Moria It sports a graphical front-end, similar to glHack or the Falcon’s eye.The design of the 3D UI is an attempt at the best of both worlds from old to new: It lets you rotate the view, zoom in/out, view special effects, and more with the feeling of the old-school isometric games like Exult or Woodward.
- More screenshots: http://scourgeweb.org/tiki-galleries.php
- Homepage: http://scourgeweb.org
- Source Code: https://bitbucket.org/uzudil/scourge2/ (Java)
Secret Maryo Chronicles is an Open Source two-dimensional platform game with a design similar to classic computer games. SMC has computer support to a great degree by using an accelerated Open Graphics Library for the best possible graphic design and stock performance.
- More screenshots: http://www.secretmaryo.org/index.php?page=media
- Homepage: http://www.secretmaryo.org/
- Source Code: https://github.com/FluXy/SMC (C++)
Danger from the Deep is an open-source World War II German U-boat simulation, striving for technical and historical accuracy.
- More screenshots: http://sourceforge.net/projects/dangerdeep/
- Homepage: http://sourceforge.net/projects/dangerdeep/
- Source Code: http://sourceforge.net/projects/dangerdeep/ (C++)
The game is a single-player and multi-player first-person ego-shooter, built as a total conversion of Cube Engine 2, which lends itself toward a balanced gameplay, completely at the control of map makers, while maintaining a general theme of agility in a variety of environments.
- More screenshots: http://sourceforge.net/apps/mediawiki/redeclipse/index.php?title=Ides_screenshots
- Homepage: http://www.redeclipse.net/
- Source Code: http://sourceforge.net/projects/redeclipse/ (C++)
Widelands is an open source (GPLed) real-time strategy game. It is built upon the SDL and other open source libraries and is (and will always be) under heavy development. If you knew Settlers I & II™ (© Bluebyte), then you already have a rough idea what Widelands is all about because widelands is heavily inspired by those two games.
- More screenshots: http://wl.widelands.org/screenshots/
- Homepage: http://wl.widelands.org/
- Source Code: https://code.launchpad.net/widelands (C++)
Unknown Horizons is a 2D realtime strategy simulation with an emphasis on economy and city building. Expand your small settlement to a strong and wealthy colony, collect taxes and supply your inhabitants with valuable goods. Increase your power with a well balanced economy and with strategic trade and diplomacy.
- More screenshots: http://www.unknown-horizons.org/media/screenshot-gallery/
- Homepage: http://www.unknown-horizons.org
- Source Code: https://github.com/unknown-horizons/ (Python)
FreeCol is a turn-based strategy game based on the old gameColonization, and similar to Civilization. The objective of the game is to create an independent nation. You start with only a few colonists defying the stormy seas in their search for new land. Will you guide them on the Colonization of a New World?
- More screenshots: http://www.freecol.org/screenshots.html
- Homepage: http://www.freecol.org
- Source Code: http://sourceforge.net/projects/freecol/ (Java)
PrBoom, the purest Doom-Port? Aims to be the most stable Doom port with the highest compatibility to the major Doom versions. Highres software and nice OpenGL rendering. Full Boom and most if not all MBF features.
- More screenshots: http://sourceforge.net/projects/prboom/
- Homepage: http://prboom.sourceforge.net/
- Source Code: http://sourceforge.net/projects/prboom/ (C)
EDuke32 is an awesome, free homebrew game engine and source port of the classic PC first person shooterDuke Nukem 3D— Duke3D for short—to Windows, Linux, Mac OS X, FreeBSD, several handhelds, your family toaster, and to your girlfriend’s vibrator. We’ve added thousands of cool and useful features and upgrades for regular players and additional editing capabilities and scripting extensions for homebrew developers and mod creators. EDuke32 is completely free, open source software.
- More screenshots: http://eduke32.com/
- Homepage: http://eduke32.com/
- Source Code: http://sourceforge.net/projects/eduke32/ (C)
VCMI Project – Heroes 3: WoG recreated -We want to rewrite the entire H3 engine (VCMI is NOT another mod) giving it new possibilities. Few years of intensive work resulted in creating application with impressive amount of features.
- More screenshots: http://forum.vcmi.eu/portal.php
- Homepage: http://forum.vcmi.eu/portal.php
- Source Code: http://sourceforge.net/projects/vcmi/ (C++)
This project, ioquake3 (or ioq3 for short,) aims to build upon id Software’s Quake 3 source code release. The source code was released on August 20, 2005 under the GPLv2. Since then, we have been cleaning up, fixing bugs, and adding features.
- More screenshots: http://ioquake3.org/extras/media/
- Homepage: http://ioquake3.org/
- Source Code: http://ioquake3.org/get-it/source-codes/ (C)
OpenArena is a community-produced deathmatch FPS based on GPL idTech3 technology. There are many game types supported including Free For All, Capture The Flag, Domination, Overload, Harvester, and more. There are 17 unique player models to choose from and 12 weapons. OpenArena is based on the ioquake3 engine mentioned above.
- More screenshots: http://openarena.ws/page.php?12
- Homepage: http://openarena.ws
- Source Code: http://openarena.ws/svn/ (C)
PlaneShift is a Role Playing Game immersed into a 3D virtual fantasy world which is to play. Fully free means you will have no surprises of premium content which will limit your gameplay or unbalance the game. There are no limitations in skills, ranks, abilities, items you can gain with your free account. There are no time limits or additional constraints. Servers and bandwidth will be donated by sponsors. PlaneShift is made by a group of RPG enthusiasts and not by a commercial company. This allows us to expand the game without any constraint or limitation. PlaneShift is Open Source for the client and server code, so everyone can contribute to its development!
- More screenshots: http://www.planeshift.it/screenshots.html
- Homepage: http://www.planeshift.it/index.php
- Source Code: http://sourceforge.net/projects/planeshift/ (C++)
X-Moto is a challenging 2D motocross platform game, where physics plays an all important role in the gameplay. You need to control your bike to its limits, if you want to have a chance to finish the most difficult challenges.
- More screenshots: http://wiki.xmoto.tuxfamily.org/index.php?title=Screenshots
- Homepage: http://xmoto.tuxfamily.org/
- Source Code: http://svn.tuxfamily.org/viewvc.cgi/xmoto_xmoto/ (C++)
The WorldForge project is about building tools to allow the construction of online role-playing games. The original community came together over a decade ago, out of a desire to create a game that was better and freer than Ultima Online. But as the aims of the project evolved and became more ambitious, the overall goal changed. Instead of one game, we instead decided build a flexible framework that would allow everyone to contribute their own unique ideas and goals to the Worldforge project, allowing a multitude of games to be created.
- More screenshots: http://worldforge.org/project/screenshots/gallery
- Homepage: http://worldforge.org/
- Source Code: https://github.com/worldforge (C++)
Vega Strike is an Open Source 3D Action-Space-Sim that lets you trade, fight, and explore in a vast universe. Vega Strike is built on top of OpenGL and runs on Win/Lin/Mac platforms. Vega Strike (the game) is currently in a playable state, but both game engine and dataset are under continued development.
- More screenshots: http://vegastrike.sourceforge.net/forums/cpg/
- Homepage: http://vegastrike.sourceforge.net/
- Source Code: http://sourceforge.net/projects/vegastrike/ (C++)
Warsow is a completely free fastpaced first-person shooter (FPS) set in a futuristic cartoon-like world for Windows, Linux and Mac OS X.
- More screenshots: http://www.warsow.net/screenshots/
- Homepage: http://www.warsow.net
- Source Code: http://www.warsow.net/download/ (C/C++)
The project started in August 2002, when Toys For Bob released the partially ported sources of Star Control 2 3DO version to the fan community. Our goal is to port this wonderful game to current personal computers and operating systems. It is and will remain 100% free of charge, and anyone can contribute to the project and thus help make it even better.
- More screenshots: http://sc2.sourceforge.net/screenshots.php
- Homepage: http://sc2.sourceforge.net/
- Source Code: http://sourceforge.net/projects/sc2/ (C)
Spring is a project aiming to create a new and versatile RTS Engine. Spring is not actually a game, but a powerful free cross-platform RTS engine.
- List of games using the engine: http://springrts.com/wiki/Games
- More screenshots: http://springrts.com/media.php
- Homepage: http://springrts.com/
- Source Code: https://github.com/spring/spring (C++)
OpenTTD is an open source simulation game based upon the popular Microprose game “Transport Tycoon Deluxe”, written by Chris Sawyer. It attempts to mimic the original game as closely as possible while extending it with new features.
- More screenshots: http://www.openttd.org/en/screenshots
- Homepage: http://www.openttd.org/en/
- Source Code: http://vcs.openttd.org/svn/browser (C++)
In Warzone 2100, you command the forces of The Project in a battle to rebuild the world after mankind has almost been destroyed by nuclear missiles. The game offers campaign, multi-player, and single-player skirmish modes. An extensive tech tree with over 400 different technologies, combined with the unit design system, allows for a wide variety of possible units and tactics.
- More screenshots: http://wz2100.net/old-site/screenshots
- Homepage: http://wz2100.net/
- Source Code: http://developer.wz2100.net/browser (C++)
0 A.D. (pronounced “zero ey-dee”) is a free, open-source, cross-platform real-time strategy (RTS) game of ancient warfare. In short, it is a historically-based war/economy game that allows players to relive or rewrite the history of Western civilizations, focusing on the years between 500 B.C. and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D graphics, detailed artwork, sound, and a flexible and powerful custom-built game engine. This is an Age of Empires clone.
- More screenshots: http://wildfiregames.com/0ad/album_cat.php?cat_id=49
- Homepage: http://wildfiregames.com/0ad/
- Source Code: http://svn.wildfiregames.com/ (C++)
Freeciv is a Free and Open Source empire-building strategy game inspired by the history of human civilization. The game commences in prehistory and your mission is to lead your tribe from the stone age to the space age.
- More screenshots: http://freeciv.wikia.com/wiki/Screenshots
- Homepage: http://freeciv.wikia.com/wiki/Main_Page
- Source Code: http://svn.gna.org/viewcvs/freeciv/ (C)
LinCity-NG is a city simulation game. It is a polished and improved version of the classicLinCity game. In the game, you are required to build and maintain a city. You can win the game either by building a sustainable economy or by evacuating all citizens with spaceships.
- More screenshots: http://lincity-ng.berlios.de/wiki/index.php/Screenshots
- Homepage: http://lincity-ng.berlios.de/wiki/index.php/Main_Page
- Source Code: http://svn.berlios.de/wsvn/lincity-ng (C++)
Simutrans is a freeware and open-source transportation simulation game.Your goal is to establish a successful transport company. Transport passengers, mail and goods by rail, road, ship and air. Interconnect cities, districts, public buildings, industries and tourist attractions by buiding a transport network you always dreamed of. Control and watch your finances and the traffic of your vehicles and goods. Start in 1880 and finish in 2050. There will be new vehicles and buildings throughout this time.
- More screenshots: http://www.simutrans.com/paksets.htm
- Homepage: http://www.simutrans.com/
- Source Code: https://github.com/aburch/simutrans (C++)
Hedgewars is a turn based strategy, artillery, action and comedy game, featuring the antics of pink hedgehogs with attitude as they battle from the depths of hell to the depths of space.
- More screenshots: http://hedgewars.org/screenshots.html
- Homepage: http://hedgewars.org/
- Source Code: http://code.google.com/p/hedgewars/ (Pascal – for an alternative in C++ you can try http://www.wormux.org)
Cube 2: Sauerbraten is a free multiplayer/singleplayer first person shooter, built as a major redesign of theCube FPS. Much like the original Cube, the aim of this game is not necessarily to produce the most features & eyecandy possible, but rather to allow map/geometry editing to be done dynamically in-game, to create fun gameplay and an elegant engine.The engine supporting the game is entirely original in code & design, and its code is Open Source (ZLIB license, read the docs for more on how you can use the engine). While you’re at it, you should check AssaultCube too.
- More screenshots: http://sauerbraten.sourceforge.net/screenshots.html
- Homepage: http://sauerbraten.org/
- Source Code: http://sourceforge.net/projects/sauerbraten/ (C++)
The Battle for Wesnoth is a Free, turn-based tactical strategy game with a high fantasy theme, featuring both single-player, and online/hotseat multiplayer combat. Fight a desperate battle to reclaim the throne of Wesnoth, or take hand in any number of other adventures.
- More screenshots: http://wiki.wesnoth.org/Screenshots
- Homepage: http://www.wesnoth.org/
- Source Code: http://svn.gna.org/viewcvs/wesnoth/ (C++)
Glest is a free 3D real-time strategy game, where you control the armies of two different factions: Tech, which is mainly composed of warriors and mechanical devices, and Magic, that prefers mages and summoned creatures in the battlefield. Glest is not just a game, but also an engine to make strategy games, based on XML and a set of tools. A few mods already exist.
- More screenshots: http://glest.org/en/gallery-screenshots.php
- Homepage: http://glest.org/en/index.php
- Source Code: http://sourceforge.net/projects/glest/ (C++)
It is the year 2084. You control a secret organisation charged with defending Earth from a brutal alien enemy. Build up your bases, prepare your team, and dive head-first into the fast and flowing turn-based combat. UFO: Alien Invasion is a squad-based tactical strategy game in the tradition of the old X-COM PC games, but with a twist. Our game combines military realism with hard science-fiction and the weirdness of an alien invasion. The carefully constructed turn-based system gives you pin-point control of your squad while maintaining a sense of pace and danger.
- More screenshots: http://ufoai.ninex.info/wiki/index.php/Media
- Homepage: http://ufoai.ninex.info/wiki/index.php/News
- Source Code: http://sourceforge.net/projects/ufoai/ (C)
Extreme Tux Racer is an open-source downhill racing game starring Tux, the Linux mascot. It follows in the path of Tux Racer and its derivatives.
- More screenshots: http://extremetuxracer.com/?screenshots
- Homepage: http://extremetuxracer.com/
- Source Code: http://sourceforge.net/projects/extremetuxracer/ (C++)
This list is not set in stone and I’ll try and update it with some personal comments for each game that I’ve played and possibly more media and links, as well as add games that should definitely make this list but I somehow missed them, thus, if you have any notable mentions that you feel I shouldn’t have left out please feel free to let me know with a comment.
Inspired by this post(read it because I am going to reference it) on the Wikitech mailing list I was inspired to write about Qt Creator, the IDE that I use for about an year now for almost any kind of C/C++ project and which I think it is pretty close to being a type 1 Integrated Development Environment, as written by Paul in that e-mail, which is a real and useful IDE, at least for my use cases. Qt Creator is a powerful and flexible IDE most useful for C/C++ code and especially when used in combination with the Qt SDK. However, due it’s extreme flexibility, Qt Creator can be tweaked to work with almost any kind of C/C++ source project, from the default qmake project files to CMake, GNU Autotools(the GNU Build System), standalone Makefiles or even custom commands for direct access command line steps for direct compiler and linkage directives.
While I prefer type 2 IDE’s for most of the day, which are powerful text editors like Vim for casual hacking or minor code modifications, which VIM excels at, especially with its modal mode, delving into an entirely unknown code base(especially a big one) or using new libraries and apis or for long coding sessions, in a simple text editor, even as powerfull as Vim or Emacs, things start to get inconvenient pretty easily and you will notice a slow down, mainly because of the poor code browsing, syntax highlighting(C++) and code completion capabilities that they posses. They are not to be blamed though and there’s also nothing wrong with them, they are simply text editors and not IDE’s. Since Vim is my favorite text editor, I tried various combinations of Ctags and CScope and all kinds of crazy hacks on top of that, just to be able to have code nagivation and code completion at least to some extent. You can find my Vimrc file in here, without Ctags and CScope, since that would make for entire post by its own.
However, I got tired of it after some time, especially because it doesn’t work that nice with some of the crazy quirks that C++ for e.g. exhibits and because I have to keep the databases that those tools use up to date frequently and manually, for every project that I am working on. For terminal only access, coding like this is fine, to some extent, however, this seemed really overkill on my desktop, especially since I am running an X desktop with a GUI and knowing that I could do better to be more productive in 2011.
Ok, let’s take a first look at how Qt Creator looks like in action, since I know I made you curious by now:
Now I’m going to list some of the strongest points and features that Qt Creator has and that I think make it stand out:
- Open Source - http://qt.gitorious.org/qt-creator
- Cross Platform – Works on Linux, Windows and Mac OS X like a charm
- Actively developed and improved
- Strong orientation and support for C/C++ native development
- Excellent syntax highlighting
- Magnificent code browsing and navigation in combination with useful and customizable keyboard shortcuts
- Great and generic(works with any file you include, it doesn’t have to know anything special about it) code completion support
- Easily customizable and Extensible through plugins
- Support for integration with various Source Control Management tools like Git, Subversion, Bazaar, Mercurial, CVS and more.
- Debugger integration with both GDB and Microsoft’s Debugging Tools for Windows through CDB (this one could use some improvement but it’s still better the debugging from the command line)
- Custom configure, build, clean and deployment steps
- Integration with tools like Valgrind
- Per project settings
- Vim editing mode
- Code snippets
- A pretty fast IDE, even when indexing hundreds of files with hundreds of thousands lines of code for the first time
- Linux Man Pages context help integration - thanks to the flexible Qt Help System, this can be extended to almost any API
Although I only listed what I like the most on top of my head, Qt Creator has many cool and useful features and the only way to experience them all, is to start using it and you really should give it a spin, because as you can see, it’s feature list is nothing close to short. You can find some videos that show you some of the features I described above in action on Youtube, but keep in mind that they are kind of old(around 2009) and Qt Creator has very much evolved a lot since then.
The how to:
Now let’s get to the main purpose of this post, using Qt Creator with GNU Build System projects. A project that follows the GNU Build System usually is composed of a configure file and several other inputs(configure.ac, Makefile.am) that help in creating the Makefiles that will build the actual project on the target platform. The GNU Build System is, of course, much more then that, but for this tutorial, that’s all you need to know and because these steps will also work for projects that have only the Makefiles for e.g.
Next I’m going to show you how easy it is to use Qt Creator with the Nmap security scanner based on the steps outlined below:
- Download and install Qt Creator from http://qt.nokia.com/downloads. At the time of writing this, I’m using Qt Creator 2.2.1. I’m going to assume you’re going to be using Linux from now on, any distro should be fine as long as you are comfortable with it, however, I am using Debian(Squeeze). If you can’t make up your mind, just use Ubuntu. For Mac OS X and Windows steps should be similar.
- Decide on a project to use. I’m going to use Nmap since that’s what I’m working on currently and because it is the perfect example of a great open source project that’s low level enough to illustrate system programming using Qt Creator. You can download the latest version tarball from http://nmap.org/download(nmap-5.59BETA1.tar.bz2 is fine). After deciding on a project, you should install all of the development dependencies(the toolchain) that your chosen project needs, like the right compiler, libraries and other tools you might need. For Nmap, for e.g., we will need gcc, openssl libraries, libpcap, perl, python, etc. If you’re on a Debian like distribution(Debian, Ubuntu), luckily you can just do apt-get build-dep nmap and you get everything you need in one shot. If you do some tests builds from the command line, remember to clean the source tree before proceeding to the next steps, since you only want to add to the project only the base files and none of the auto generated files from the build system.
- Assuming you installed Qt Creator successfully, open it and go to File -> New File or Project -> Other Project and click on Import Existing Project. Advance to the next screen.
- In the current screen, give your project a name(that name will be used for your project files too so don’t go crazy with spaces or special chars) and select the location to your project source tree. In the nmap example, Nmap is a good project name and for Location browse to the path where you extracted the nmap source archive. Click on Next.
- The next screen, Project Management, is going to ask you if you want to use source control management(git, svn) for your project and if yes,then the project files will be the first to be added to the project. You should add these files to the scm repository only if you know that they would be usefull for others, otherwise you should keep them to your self, by using exclude directives like .gitignore files in git or svn:ignoreproperty in svn. For the Nmap case, the project files are:
- Nmap.config – Project configuration settings like predefined Macros
- Nmap.creator - Qt Creator settings
- Nmap.files – A listing of all the files included in the project
- Nmap.includes – Include directories
- Nmap.creator.user – This one is excluded from adding to svn since it stores per user project settings.
- Assuming everything went fine, you should now have your project open in Qt Creator and ready to proceed to project settings. On the left side of Qt Creator click on Projects. Right now you’re looking at the Build Settings screen. This is where you set your project building and cleaning steps. For Nmap, the building process is made of the configure step and the make step. The clean process is made of the make cleanstep. Let’s add these steps to the build settings:
- On the Build Steps section click on Add Build Step -> Custom Process Step. Click on Enable Custom Process Step checkbox and add the following command to the Command: text box: ./configure. Move this step to the top of the stack by clicking on the upper arrow that fades in when you hover the build step. This step, the configure process, can only be run once and then disabled, since you don’t really need to run it again unless you run make distclean or modify the build system.
- Now expand the Make step and deselect the all checkbox in the Targets section. We don’t need that argument for Nmap, since Nmap’s Makefiles doesn’t have an “all” target. Now all the make step will do is issuing the make command.
- Now let’s proceed to the deployment steps, the Run Settings tab next to Build Settings, assuming that you would want to run Nmap in a basic form after a successful build just to know that everything runs smoothly. However for most cases, with tools like Nmap that have dozens of command line arguments you’re better of with running from an external terminal window, instead of modifying the arguments all over again in Run Settings when you need them changed. For this case, we’ll just want to run nmap with the version argument, ./nmap -V:
- Switch over to the Edit mode on the left sidebar and press Ctrl^Shift^s to save your changes and start Building by pressing Ctrl^b.
Wait for the build to finish and you are ready to run your executable by pressing Ctrl^r. In Nmap’s case you should see a window popping with Nmap version output:
That’s it! This is how simple it is to use Qt Creator with a project like Nmap, that has nothing to do with Qt or qmake whatsoever, all you need to do, is know a little bit about the specific project’s build process and toolchain and describe them to Qt Creator as build steps.
I’ve been using this process on many non Qt projects like John the Ripper, skipfish, VCMI(Heroes 3 oss clone), GNU Coreutils and many more besides Nmap, of course, projects which are in both C and C++ and all I can say is that Qt Creator helped me a lot in the cases where a text editor didn’t(and shouldn’t try to) excel at. None of the other choices available as free and open source IDE’s out there could match Qt Creator in my opinion and I really hope that the Creator will continue in the same manner it has so far, free and open source, cross-platform, actively developed and supported, flexible and not locked to the Qt framework. Here are other alternatives to Qt Creator that I’ve used in the paste and still use from time to time for specific certain tasks that they do well besides Qt Creator and adhere at least to the open source, cross-platform and good for native development rules: KDevelop, Code::Blocks, Anjuta and Geany (no, I’m not going to mention Eclipse and Netbeans since they are not that good for native programming).
All in all, Qt Creator is a great IDE for general C/C++ development and even if it can’t currently beat the behemoth that is Visual Studio in certain aspects, it wouldn’t even be fair to compare them until Visual Studio will strive for cross platform compatibility, multiple compilers and debuggers support or the ability to use multiple revision control systems.
Give it a spin, you won’t regret.
I’ve been running this poll in the sidebar for several months now, Which OS do you currently use the most? and now it’s time to close it and draw the results:
Which OS do you currently use the most?
- Windows (51%, 57 Votes)
- Linux (39%, 43 Votes)
- BSD (5%, 6 Votes)
- Mac (5%, 5 Votes)
Total Voters: 111
The new poll:
The best pentesting distribution is?
- Backtrack (61%, 252 Votes)
- Other (18%, 74 Votes)
- nUbuntu (9%, 36 Votes)
- Network Security Toolkit (2%, 9 Votes)
- General Knoppix (2%, 8 Votes)
- Pentoo (2%, 7 Votes)
- Samurai (2%, 7 Votes)
- Helix (1%, 4 Votes)
- STD (1%, 4 Votes)
- INSERT (1%, 3 Votes)
- Operator (1%, 3 Votes)
Total Voters: 412
I only included distributions that are currently at least available for download, since many of them have been discontinued and distros like PHLAK or Auditor don’t even have a homepage anymore.