{"id":806,"date":"2010-02-02T22:06:51","date_gmt":"2010-02-02T21:06:51","guid":{"rendered":"http:\/\/mehm.net\/blog\/?p=806"},"modified":"2010-02-06T14:18:17","modified_gmt":"2010-02-06T13:18:17","slug":"setting-up-eclipse-cdt-with-qt-on-ubuntu","status":"publish","type":"post","link":"https:\/\/mehm.net\/blog\/?p=806","title":{"rendered":"Setting up Eclipse CDT with Qt on Ubuntu"},"content":{"rendered":"<p>Since I said I wanted to work on the <a href=\"http:\/\/mehm.net\/blog\/?p=794\">GameBoy emulator project<\/a> in a new environment, I was checking out some possible IDEs in Linux and have decided to go with <a href=\"http:\/\/www.eclipse.org\/cdt\/\">Eclipse CDT<\/a>, the C++-IDE version of <a href=\"http:\/\/www.eclipse.org\">Eclipse<\/a>. I looked at some other popular IDEs such as <a href=\"http:\/\/projects.gnome.org\/anjuta\/\">Anjuta<\/a> or <a href=\"http:\/\/www.kdevelop.org\/\">KDevelop<\/a> (which is getting some really fancy features and should definitely be checked out again), but in the end getting a project up and running with Eclipse felt like the least effort. Concerning the GUI framework, I decided to go for <a href=\"http:\/\/qt.nokia.com\/products\">Qt<\/a>.<\/p>\n<p>I&#8217;ll outline the steps necessary to get the IDE running, mind you that I&#8217;m not a linux expert so some steps might be backwards, and I&#8217;ll probably leave some details out.<\/p>\n<p><strong>Installing Linux<\/strong><\/p>\n<p><strong><img loading=\"lazy\" class=\"alignnone size-medium wp-image-810\" src=\"http:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/01\/UbuntuLogo-300x78.png\" alt=\"UbuntuLogo\" width=\"300\" height=\"78\" srcset=\"https:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/01\/UbuntuLogo-300x78.png 300w, https:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/01\/UbuntuLogo-1024x266.png 1024w, https:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/01\/UbuntuLogo.png 1501w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/strong><\/p>\n<p>Since it&#8217;s probably the most widespread Linux and therefore the easiest to find help for, I went with Ubuntu Linux, available at <a href=\"www.ubuntu.org\">www.ubuntu.org<\/a>. If, like me, you start out with an installed Windows, a tip is to use the <a href=\"http:\/\/www.linuxliveusb.com\/\">Linux Live USB creator<\/a>, which makes it extremely easy to download the latest version of Ubuntu and create a bootable USB stick from it.<\/p>\n<p>(As a side-note, I&#8217;m quite impressed how easy it has become to install Linux. However, to not put things out of perspective, I was also impressed by the ease of the Windows 7 installation).<\/p>\n<p><strong>Installing Eclipse<\/strong><\/p>\n<p><strong><img loading=\"lazy\" class=\"alignnone size-medium wp-image-811\" src=\"http:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/eclipse-300x194.png\" alt=\"eclipse\" width=\"300\" height=\"194\" srcset=\"https:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/eclipse-300x194.png 300w, https:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/eclipse.png 450w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/strong><\/p>\n<p>Under Ubuntu\/Debian, there&#8217;s always the question if you want to go with the (possibly outdated) versions of software in the repository available using apt-get. Since eclipse doesn&#8217;t really have to be installed explicitly, I decided to use the up-to-date version from <a href=\"www.eclipse.org\">www.eclipse.org<\/a>. The CDT (C++ Development Tooling) version is available via the Downloads page.<\/p>\n<p>By default Ubuntu only installs the GCJ Java virtual machine, since eclipse seems to have problems with that VM I downloaded the Sun VM and start eclipse with the command &#8220;eclipse -vm \/path\/to\/JRE&#8221;.<\/p>\n<p><strong>Update:<\/strong> Using the default fonts and font sizes of Ubuntu, Eclipse wastes an insane amount of screen space, to the point where my 24 inch monitor seemed too small. This <a href=\"http:\/\/blog.xam.dk\/?p=70\">blog post<\/a> describes what can be done to counter this (works similarly for Ubuntu).<\/p>\n<p><strong>Installing Qt<\/strong><\/p>\n<p><strong><img loading=\"lazy\" class=\"alignnone size-full wp-image-819\" src=\"http:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/qtLogo1.png\" alt=\"qtLogo\" width=\"174\" height=\"71\" \/><br \/>\n<\/strong><\/p>\n<p>Since Qt has been taken over by Nokia, it is now available at their site: <a href=\"http:\/\/qt.nokia.com\/downloads\">http:\/\/qt.nokia.com\/downloads<\/a>. If all requirement are installed, a simple &#8220;.\/configure&#8221;, &#8220;make&#8221;, &#8220;make install&#8221; should suffice, otherwise, the configuration script will report the missing files. The Qt Eclipse integration installation on Linux is described <a href=\"http:\/\/qt.nokia.com\/developer\/eclipse-integration\/installation-instructions-for-linux-systems\">here<\/a>.<\/p>\n<p><strong>Subversion<\/strong><\/p>\n<p><strong><img loading=\"lazy\" class=\"alignnone size-medium wp-image-813\" src=\"http:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/subversionLogo-300x41.png\" alt=\"subversionLogo\" width=\"300\" height=\"41\" srcset=\"https:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/subversionLogo-300x41.png 300w, https:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/subversionLogo.png 468w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/strong><\/p>\n<p>It seems like there is not really a good replacement for <a href=\"http:\/\/tortoisesvn.tigris.org\/\">TortoiseSVN<\/a> in Linux, so for me the solution was to use a SVN client integrated in Eclipse. This can be achieved using the Eclipse Subversive Team Provider available <a href=\"http:\/\/www.eclipse.org\/subversive\/index.php\">here<\/a>.<\/p>\n<p>In a nutshell using SVN is allowed by the two following steps:<\/p>\n<p>Install the &#8220;Subversive SVN Team Provider&#8221; from the Galileo Software Site.<\/p>\n<p>Install a Subversive SVN Connector from the software site <a class=\"linkification-ext\" title=\"Linkification: http:\/\/community.polarion.com\/projects\/subversive\/download\/eclipse\/2.0\/galileo-site\/\" href=\"http:\/\/community.polarion.com\/projects\/subversive\/download\/eclipse\/2.0\/galileo-site\/\">http:\/\/community.polarion.com\/projects\/subversive\/download\/eclipse\/2.0\/galileo-site\/<\/a>.<\/p>\n<p>The last step is then to configure the SVN connector to use in the Preferences, Team-&gt;SVN.<\/p>\n<p><strong>Unit Testing<\/strong><\/p>\n<p><strong><img loading=\"lazy\" class=\"alignnone size-full wp-image-814\" src=\"http:\/\/mehm.net\/blog\/wp-content\/uploads\/2010\/02\/CUTElogo.png\" alt=\"CUTElogo\" width=\"160\" height=\"106\" \/><br \/>\n<\/strong><\/p>\n<p>Writing an emulator includes writing code which interprets commands of the target architecture as faithfully as possible. This sounds to me like a task that screams unit testing, therefore, I looked into a good unit testing framework compatible with Eclipse. It seems like this is the case with the CUTE (C++ Unit Testing Easy) framework, available and described <a href=\"http:\/\/r2.ifs.hsr.ch\/cute\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I said I wanted to work on the GameBoy emulator project in a new environment, I was checking out some possible IDEs in Linux and have decided to go with Eclipse CDT, the C++-IDE version of Eclipse. I looked at some other popular IDEs such as Anjuta or KDevelop (which is getting some really [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,3],"tags":[68,70,67,71,69],"_links":{"self":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/806"}],"collection":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=806"}],"version-history":[{"count":12,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/806\/revisions"}],"predecessor-version":[{"id":832,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/806\/revisions\/832"}],"wp:attachment":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}