<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kerry D. Wong &#187; Code::Blocks</title>
	<atom:link href="http://www.kerrywong.com/tag/codeblocks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerrywong.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 00:51:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>C++ IDEs Under Linux</title>
		<link>http://www.kerrywong.com/2009/04/18/c-ides-under-linux/</link>
		<comments>http://www.kerrywong.com/2009/04/18/c-ides-under-linux/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 02:27:04 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Code::Blocks]]></category>
		<category><![CDATA[KDevelop]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=964</guid>
		<description><![CDATA[So far I have been mainly using KDevelop and Code::Blocks as my C++ development IDEs. Recently, I started using NetBeans IDE for C++ and I started to like it quite a bit. In my opinion, the above three IDEs all have their strengths and weaknesses depending on what kind of project you are working on. [...]]]></description>
			<content:encoded><![CDATA[<p>So far I have been mainly using <a href="http://www.kdevelop.org">KDevelop</a> and <a href="http://www.codeblocks.org">Code::Blocks</a> as my C++ development IDEs. Recently, I started using <a href="http://www.netbeans.org/">NetBeans IDE</a> for C++ and I started to like it quite a bit.<span id="more-964"></span></p>
<p>In my opinion, the above three IDEs all have their strengths and weaknesses depending on what kind of project you are working on. Here are some of my observations.<br />
<strong><br />
KDevelop is probably the most comprehensive IDE of the three</strong>. This should not come as a surprise as it has been around for more than 10 years and it bas been the de facto development environment for most of the <a href="http://www.kde.org">KDE</a> development work. It is very feature rich and you can use it to develop many different types of applications natively out of box (e.g. KDE, GTK+, Qt, wxWidgets, etc). If you are developing <a href="http://www.gnu.org">GNU</a> style applications, you will benefit from the Automake project type if provides. Besides the vast functionalities KDevelop provides, it is also very fast, efficient and stable. </p>
<p>Nonetheless, KDevelop is not the most intuitive IDE and does not suit small projects (e.g. prof of concept code) well as the initial project setup can be time consuming.</p>
<p><strong>Code::Blocks is a very capable IDE for C++ development as well</strong>. It offers many project templates even though it does not offer native KDE project types. This should not be a problem to most people however. Among the features I like the most is that it does not require explicit make file configuration and the build dependencies are inferred by default. This makes it very attractive for rapid prototyping. Debugging under Code::Blocks is also a pleasant experience. It also integrates (at least in the later SVN versions) <a href="http://valgrind.org/">Valgrind</a>&#8216;s MemCheck and Cachegrind, which are very useful for detecting memory leaks and tweaking algorithms for the maximum performance.</p>
<p>The latest stable version of Code::Blocks is 8.02, it is a little dated as a lot of functionalities have been added in the later SVN builds. If you do not require the most stability (I have run into <a href="/2009/04/15/how-to-revert-to-a-specific-svn-version-of-codeblocks/">some issues</a> recently), using SVN build should not be a problem. The editor (e.g. syntax highlighting, collapsible regions) is a little bit buggy though and the contextual help does not always work to the level of detail I desired. </p>
<p><strong>NetBeans C++ IDE is probably the most beautiful one among the three</strong>. It offers the most detailed syntax highlighting, and can be configured to display class hierarchy and library function information. The refactor tool works pretty well and is certainly a boon to large scale development. Its contextual help is also of top-notch.</p>
<p>All of these come at a cost of course. NetBeans C++ IDE is the most resource intensive among the three. It can easily use 500 MB memory when doing development and can be sluggish at times. It also comes with a very limited project template (e.g. no out-of-box project templates for Qt, wxWidgets). Certain settings <a href="http://www.netbeans.org/kb/docs/cnd/toolchain.html">are hard to get at</a> as well. Nevertheless, if I am primarily writing back-end code, NetBeans C++ IDE could easily earn my top choice. </p>
<p>Some people like <a href="http://www.anjuta.org">Anjuta</a> and compare it favorably to Code::Blocks. But I haven&#8217;t got a chance to use it yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2009/04/18/c-ides-under-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Revert to a Specific SVN Version of Code::Blocks</title>
		<link>http://www.kerrywong.com/2009/04/15/how-to-revert-to-a-specific-svn-version-of-codeblocks/</link>
		<comments>http://www.kerrywong.com/2009/04/15/how-to-revert-to-a-specific-svn-version-of-codeblocks/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 23:52:45 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Code::Blocks]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=960</guid>
		<description><![CDATA[I had set up my apt-get source to use latest SVN build of Code::Blocks. Everything has been running pretty smoothly until a couple of days ago when Code::Blocks was updated to SVN 5534. It seemed that for whatever reason, this particular build is extremely unstable on my Ubuntu 8.04 box and it would refuse to [...]]]></description>
			<content:encoded><![CDATA[<p>I had set up my apt-get source to use latest SVN build of Code::Blocks. Everything has been running pretty smoothly until a couple of days ago when Code::Blocks was updated to SVN 5534.<span id="more-960"></span> It seemed that for whatever reason, this particular build is extremely unstable on my Ubuntu 8.04 box and it would refuse to open any projects created prior to SVN 5534.</p>
<p>So naturally, I wanted to revert back to my previous working version (SVN 5489). There are some <a href="http://lgp203.free.fr/spip/spip.php?article1">instructions on lgp203.free.fr</a> that in theory should work to install any revisions of Code::Blocks from SVN. But the script provided there did not work for me as it was complaining about not able to find certain packages. So I decided to do it manually, and here are the steps I took to get SVN 5489 installed.</p>
<p>First, you will need to remove the installed version of Code::Blocks.</p>
<blockquote><p>sudo apt-get remove codeblocks<br />
sudo apt-get remove codeblocks-common</p></blockquote>
<p>Then you will need to install the Debian packages one by one from lgp203.free.fr. using </p>
<blockquote><p>wget http://lgp203.free.fr/pool/codeblocks/wxsmith-headers_8.02svn5489_all.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/libwxsmithlib0_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-headers_8.02svn5489_all.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/libcodeblocks0_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-common_8.02svn5489_all.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-contrib_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-contrib-common_8.02svn5489_all.deb</p></blockquote>
<blockquote><p>sudo dpkg -i wxsmith-headers_8.02svn5489_all.deb<br />
sudo dpkg -i libwxsmithlib0_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks-headers_8.02svn5489_all.deb<br />
sudo dpkg -i libcodeblocks0_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks-common_8.02svn5489_all.deb<br />
sudo dpkg -i codeblocks-contrib_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks-contrib-common_8.02svn5489_all.deb
</p></blockquote>
<p>You can find a full list of all the available Code::Blocks&#8217; SVN versions <a href="http://lgp203.free.fr/ubuntu/dists/">here</a>. Now, I am running version 5489 and everything is working again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2009/04/15/how-to-revert-to-a-specific-svn-version-of-codeblocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code::Blocks Settings for Qt Development</title>
		<link>http://www.kerrywong.com/2008/07/12/codeblocks-settings-for-qt-development/</link>
		<comments>http://www.kerrywong.com/2008/07/12/codeblocks-settings-for-qt-development/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 01:32:27 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Code::Blocks]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/2008/07/12/codeblocks-settings-for-qt-development/</guid>
		<description><![CDATA[Qt is a cross-platform object oriented C++ framework for application development. KDE is written using Qt. And not surprisingly, KDE comes with native support for building Qt based applications. In KDE, KDevelop is the default IDE under Linux for creating Qt based applications. For smaller projects however, it seems that the feature richness of KDevelop [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://trolltech.com/products/qt">Qt</a> is a cross-platform object oriented C++ framework for application development.<span id="more-315"></span> <a href="http://www.kde.org/">KDE</a> is written using Qt. And not surprisingly, KDE comes with native support for building Qt based applications. In KDE, <a href="http://www.kerrywong.com/blog/wp-admin/www.kdevelop.org/">KDevelop</a> is the default IDE under Linux for creating Qt based applications. For smaller projects however, it seems that the feature richness of KDevelop is almost an overkill.</p>
<p align="left">I personally like simplicity of Code::Blocks when writing small programs. Even though Code::Blocks does come with Qt support, you will have to tell it where Qt is installed before you can compile your code correctly. Like any other C++ environment, the two things you must provide are the include path and the linker path.</p>
<p align="left">Ubuntu 8.04 comes with Qt3 installed, to install Qt4, please follow the instructions <a href="http://ubuntu-gamedev.wikispaces.com/Simple+GUI+Using+QT4">here</a>. Here are the build options you need to add with the default Qt4 install:</p>
<p><a title="qtlinkersettings.gif" href="http://www.kerrywong.com/blog/wp-content/uploads/2008/07/qtlinkersettings.gif"></p>
<p style="text-align: center;"><img alt="qtlinkersettings.gif" src="http://www.kerrywong.com/blog/wp-content/uploads/2008/07/qtlinkersettings.gif" /></p>
<p></a>  <a title="qtsearchdirs.gif" href="http://www.kerrywong.com/blog/wp-content/uploads/2008/07/qtsearchdirs.gif"></p>
<p style="text-align: center;"><img alt="qtsearchdirs.gif" src="http://www.kerrywong.com/blog/wp-content/uploads/2008/07/qtsearchdirs.gif" /></p>
<p></a>  As a bare minimum, you will need to set the libQtGui and libQtCore libraries paths. Note thatUbuntu 8.04 comes with Qt3 installed, when you specify the libraries you need to make sure you specify the ones with the correct version. In my example, the required Qt4 libraries are /usr/lib/libQtGui.so.4 and /usr/lib/libQtCore.so.4.  You also need to specify where the include files can be found. For typical applications, /ur/incude/qt4 and /usr/include/qt4/QtGui are the paths you will need.  If you want contextual help to be available, you will have to provide the search paths for the include files under &quot;C/C++ parser options&quot; tab in Project/targets options settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/07/12/codeblocks-settings-for-qt-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Develop TBB Using KDevelop and Code::Blocks</title>
		<link>http://www.kerrywong.com/2008/06/01/develop-tbb-using-kdevelop-and-codeblocks/</link>
		<comments>http://www.kerrywong.com/2008/06/01/develop-tbb-using-kdevelop-and-codeblocks/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 01:20:23 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Code::Blocks]]></category>
		<category><![CDATA[KDevelop]]></category>
		<category><![CDATA[TBB]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/2008/06/01/develop-tbb-using-kdevelop-and-codeblocks/</guid>
		<description><![CDATA[I have been playing around with Intel&#8217;s open source TBB (Threading Building Block) recently.The default download includes all the sources that can run on Windows , Linux or Mac OS X. The linux version however, builds using the shell by default and does not support any IDE&#8217;s (the Windows version can be built using Visual [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing around with Intel&#8217;s open source <a href="http://www.threadingbuildingblocks.org/">TBB</a> (Threading Building Block) recently.<span id="more-291"></span>The default download includes all the sources that can run on Windows , Linux or Mac OS X. The linux version however, builds using the shell by default and does not support any IDE&#8217;s (the Windows version can be built using Visual Studio 2003 or 2005). Even though running TBB applications under any Linux IDEs is not all that different comparing to doing the same under Windows, I found that there were not many tutorials on the Internet on how to do this. So here, I will show you how to setup <a href="http://www.kdevelop.org/">KDevelop</a> and <a href="http://www.codeblocks.org">Code::Blocks</a> for you TBB development and debugging.</p>
<p>KDevelop is a powerful multi-language development IDE that comes as default package for the KDE environment (e.g. Kubuntu). For those who are using GNOME, it can be easily installed via apt-get install (Ubuntu).</p>
<p>The KDevelop IDE is one of the most feature-rich inegrated programming environments on Linux, but unfortunately it is not the easiest to get started due to its overwhelmingly large feature set. Here I will show you what I found the easiest way to set up a project that supports TBB, using the Automake project type.</p>
<p>The version of KDevelop I am using is 3.5.9. The commands might be slightly different in other versions, but the idea should be the same. To start a TBB application, use Automake project type (Projects -&gt; New Projects, under C++ Automake Project, choose Empty Autotools Template.)</p>
<div align="center">
<p><img alt="" src="/blog/wp-content/uploads/2008/06/tbb_kde_1.png" /></p>
</div>
<p>Don&#8217;t be surprised to see a few dozens of files being created, most of these files are used for program auto-configurations.</p>
<p>For all Automake projects, an active target is needed. So we will need to create an active target. By default, all the targets are configured within the right-hand-side split panels. The name of the active target will be compiled into the binary executable. In my example below, the target is named as tbbdev. In my example, I will use one of the stock program (sub_string_finder.cpp) that came with the TBB source code. It can be found in <em><strong>{TBB Source root}</strong></em>/examples/GettingStarted/sub_string_finder/</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/06/tbb_kde_2.png" alt="" /></p>
<p align="left">&nbsp;In order for the target application to find the shared library at runtime, we need to setup an environment variable LD_LIBRARY_PATH. The setting can be found at Project -&gt; Project Options.</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/06/tbb_kde_3.png" alt="" /></p>
<p align="left">In the example given above, the TBB library source was extracted within my user&#8217;s root folder under tbb (<strong>/home/kwong/tbb</strong>/tbb20_020oss_src/), and the library I used is for 64 bit operating systems. Depending on whether it is debug build or release build, choose library path accordingly.</p>
<p align="left">Next we need to configure the build target. The include paths are configured at the root project level (which is the parent to all configured targets).</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/06/tbb_kde_4.png" alt="" /></p>
<p align="left">the added directory should take the following format: -l<em><strong>{TBB installation root}</strong></em>/include/.</p>
<p align="left">Then we will configure the target library path (this takes place at the active target level):</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/06/tbb_kde_5.png" alt="" />2</p>
<p align="left">Note the syntax, the first part (-L) specifies the library path, and the second part (-l) specifies the library name. The actual library is called libtbb_debug.so.</p>
<p align="left">That&#8217;s all the settings you will need to compile and run the sample program. Before you start debugging though, make sure that the current target is set to be built in debug mode (For some reason, the default build config does not support debugging and thus you can not set breakpoints within the IDE):</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/06/tbb_kde_6.png" longdesc="http://www.kerrywong.com/undefined" alt="" /></p>
<p align="left">Alternatively, you can also change the compiler flags (CXXFLAGS) to -O0 -g3 (in prorject options).</p>
<p align="left">After the above steps, you should be able to compile, debug and run the sample TBB program from within KDevelop.</p>
<p align="left">As I suggested earlier, Kdevelop might not be the easiest to configure and run since it is mainly geared towards the more complex KDE applications. If you are so used to Microsoft Visual Studio IDEs, you might find <a href="http://www.codeblocks.org/">Code::Blocks</a> much easier to use.</p>
<p align="left">Start Code::Blocks, and choose File -&gt; New -&gt; Project and choose Console Application. Again, we will use the sub_string_finder.cpp sample code. The library path/include path properties can be set either at the Workspace level (one workspace can contain multiple projects and the settings are inherited unless overwritten) or project level. Assume that we are configuring at the workspace level. Click and highlight the workspace, and choose from menu Project -&gt; Build Options and click on the Linker settings tab. Add the libraries to be linked here:</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/06/tbb_cbk_1.png" alt="" /></p>
<p align="left">Note that only the first entry was necessary for this particular project. As you can see from above, you can configure multiple library dependencies here easily. Now click on the Search directories tab, and set up the include path:</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/06/tbb_cbk_2.png" alt="" /></p>
<p align="left">Now you can build and debug the application in Code::Blocks.&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/06/01/develop-tbb-using-kdevelop-and-codeblocks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
