<?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>Seven steps &#187; C++</title>
	<atom:link href="http://trevoke.net/blog/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://trevoke.net/blog</link>
	<description>Martial arts and technology, $DEITY what a mix!</description>
	<lastBuildDate>Wed, 01 Feb 2012 03:43:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Howto: SFML with Netbeans</title>
		<link>http://trevoke.net/blog/2009/03/08/howto-sfml-with-netbeans/</link>
		<comments>http://trevoke.net/blog/2009/03/08/howto-sfml-with-netbeans/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 23:56:24 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sfml]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=80</guid>
		<description><![CDATA[SFML, the Simple and Fast Multimedia Library, doesn't have a tutorial to get started with Netbeans. Here's one!]]></description>
			<content:encoded><![CDATA[<p>
<a  href="http://www.sfml-dev.org/index.php" onclick="javascript:pageTracker._trackPageview('/external/www.sfml-dev.org/index.php');" >SFML</a>, the Simple and Fast Multimedia Library, has tutorials for Code::Blocks, plain GCC, Visual Studio, but not Netbeans. Well, I like Netbeans. This tutorial isn&#8217;t perfect &#8211; the library names are fine for GNU/Linux and not for Windows, refer to the SFML howto for Windows to determine what library names to use. This will show you how to set up a Netbeans project to use SFML.<span id="more-80"></span><br />
First things first &#8211; as I am running Gentoo on an x86_64 system (AMD64), I compiled the libraries myself. Don&#8217;t forget to do that if that&#8217;s your thing &#8211; I spent two evenings wondering why it wasn&#8217;t working.</p>
<p>First, go to Tools &gt; Options and find the C/C++ heading. If it&#8217;s not there, you have to first create a C++ project to activate the feature. I have my SFML headers under &#8216;/home/alg/workspace/SFML-1.4/include &#8211; replace that path with the INCLUDE path of wherever you downloaded the SFML libs. Don&#8217;t use the &#8216;SFML&#8217; subdirectory &#8211; use the &#8216;INCLUDE&#8217; directory.</p>
<div id="attachment_81" class="wp-caption alignnone" style="width: 485px">
<a  href="http://trevoke.net/blog/wp-content/uploads/2009/03/001.jpg" onclick="javascript:pageTracker._trackPageview('/external/trevoke.net/blog/wp-content/uploads/2009/03/001.jpg');" ><img class="size-full wp-image-81" title="Enabling Code Assistance" src="http://trevoke.net/blog/wp-content/uploads/2009/03/001.jpg" alt="Tools &gt; Options &gt; Code Assistance &gt; C++ Compiler" width="475" height="295" /></a><p class="wp-caption-text">Tools &gt; Options &gt; Code Assistance &gt; C++ Compiler</p></div>
<p>Next, on to the project itself. Right-click on the project in the project list and go to Properties.</p>
<div id="attachment_82" class="wp-caption alignnone" style="width: 331px">
<a  href="http://trevoke.net/blog/wp-content/uploads/2009/03/002.jpg" onclick="javascript:pageTracker._trackPageview('/external/trevoke.net/blog/wp-content/uploads/2009/03/002.jpg');" ><img class="size-full wp-image-82" title="Project Properties" src="http://trevoke.net/blog/wp-content/uploads/2009/03/002.jpg" alt="Right click on project - go to properties" width="321" height="579" /></a><p class="wp-caption-text">Right click on project - go to properties</p></div>
<p>Now, you need to be aware that there are at least two configurations &#8211; Debug and Release. Unless you want to debug output from SFML, you should change the Configuration to &#8220;All Configurations&#8221; so that both testing and release get affected by the following changes, otherwise when you compile the release.. It&#8217;ll break and you may have forgotten why.</p>
<div id="attachment_83" class="wp-caption alignnone" style="width: 445px">
<a  href="http://trevoke.net/blog/wp-content/uploads/2009/03/004.jpg" onclick="javascript:pageTracker._trackPageview('/external/trevoke.net/blog/wp-content/uploads/2009/03/004.jpg');" ><img class="size-full wp-image-83" title="Configuration  - All Configurations." src="http://trevoke.net/blog/wp-content/uploads/2009/03/004.jpg" alt="Configuration - All configurations" width="435" height="113" /></a><p class="wp-caption-text">Configuration - All configurations</p></div>
<p>Go to Build &gt; C++ Compiler, and enter/select the SFML include directory in the &#8216;Include Directories&#8217; option.</p>
<div id="attachment_85" class="wp-caption alignnone" style="width: 795px">
<a  href="http://trevoke.net/blog/wp-content/uploads/2009/03/003.jpg" onclick="javascript:pageTracker._trackPageview('/external/trevoke.net/blog/wp-content/uploads/2009/03/003.jpg');" ><img class="size-full wp-image-85" title="Project include directories" src="http://trevoke.net/blog/wp-content/uploads/2009/03/003.jpg" alt="Setting the project's include directories" width="785" height="124" /></a><p class="wp-caption-text">Setting the project&#39;s include directories</p></div>
<p>The next and last step is to go to the linker and add the libraries themselves. The button on the right comes in very handy here.</p>
<div id="attachment_86" class="wp-caption alignnone" style="width: 746px">
<a  href="http://trevoke.net/blog/wp-content/uploads/2009/03/005a.jpg" onclick="javascript:pageTracker._trackPageview('/external/trevoke.net/blog/wp-content/uploads/2009/03/005a.jpg');" ><img class="size-full wp-image-86" title="Linker window" src="http://trevoke.net/blog/wp-content/uploads/2009/03/005a.jpg" alt="On which line do we add it? The one that says Libraries!" width="736" height="149" /></a><p class="wp-caption-text">On which line do we add it? The one that says Libraries!</p></div>
<p>So, if you click on the three dots, you get the following window. I chose to store the libraries as full paths, it probably doesn&#8217;t make a huge difference in the context of creating the program &#8211; but maybe in the outside world you just want to have the libraries in the same folder to make your life easier.</p>
<div id="attachment_87" class="wp-caption alignnone" style="width: 690px">
<a  href="http://trevoke.net/blog/wp-content/uploads/2009/03/005b.jpg" onclick="javascript:pageTracker._trackPageview('/external/trevoke.net/blog/wp-content/uploads/2009/03/005b.jpg');" ><img class="size-full wp-image-87" title="Where the libraries are" src="http://trevoke.net/blog/wp-content/uploads/2009/03/005b.jpg" alt="Adding libraries!" width="680" height="130" /></a><p class="wp-caption-text">Adding libraries!</p></div>
<p>This should be all you need to do&#8230; Now you&#8217;re on your own, all alone with the internet to help you. Happy hacking! Please let me know if anything is incorrect or if you have any additions to make.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2009/03/08/howto-sfml-with-netbeans/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.263 seconds -->

