<?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>Dalton Filho &#187; Windows</title>
	<atom:link href="http://www.daltonfilho.com/tag/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daltonfilho.com</link>
	<description></description>
	<lastBuildDate>Tue, 12 Oct 2010 02:42:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>wxWidgets on Windows using NetBeans 6.0 with MinGW + MSYS</title>
		<link>http://www.daltonfilho.com/2008/02/23/wxwidgets-on-windows-using-netbeans-60-with-mingw-msys/</link>
		<comments>http://www.daltonfilho.com/2008/02/23/wxwidgets-on-windows-using-netbeans-60-with-mingw-msys/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 01:35:09 +0000</pubDate>
		<dc:creator>Dalton Filho</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[MinGW]]></category>
		<category><![CDATA[MSYS]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://www.daltonfilho.com/2008/02/23/wxwidgets-on-windows-using-netbeans-60-with-mingw-msys/</guid>
		<description><![CDATA[Setting up a wxWidgets project on Windows using NetBeans 6.0 is quite harder than doing the same on Linux, but if you want to be able to use the powerful features of NetBeans instead of smaller IDEs like wxDev-cpp, here is a quick guide to setup your environment.]]></description>
			<content:encoded><![CDATA[<p>Setting up a wxWidgets project on Windows using NetBeans 6.0 is quite harder than doing the same on Linux, but if you want to be able to use the powerful features of NetBeans instead of smaller IDEs like wxDev-cpp, here is a quick guide to setup your environment. The first thing you will need is to setup MinGW and MSYS to compile wxWidgets:</p>
<ol>
<li>Download and install <a title="MinGW download" href="http://sourceforge.net/projects/mingw/files_beta/">MinGW</a> if you don&#8217;t already have it. Add MinGW&#8217;s <code>bin</code> subdirectory to your <code>PATH</code> environment variable. Note that if you use Vista, you <em>must</em> override GCC&#8217;s utilities with their corresponding <a href="http://sourceforge.net/project/showfiles.php?group_id=2435&amp;package_id=82723">Vista builds</a>;</li>
<li>Download and install MSYS &#8211; you will need it to compile wxWidgets. Add its bin subdirectory to <code>PATH</code> as you did with MinGW;</li>
<li>Open the MSYS console and navigate to the directory where you extracted wxWidgets (or where the installation put the files from wxWidgets);</li>
<li>Create a directory for your build (<code>mkdir build-static-debug</code>) and navigate to it. You may want to use other names;</li>
<li>Run configure with your preferred options, which may include
<ul>
<li><code>--enable-debug</code> &#8211; enable debugging info</li>
<li><code>--enable-optimise</code> &#8211; create optimised code</li>
<li><code>--disable-shared</code> &#8211; create static libraries (use this unless you want to distribute wxWidgets dlls with your application)</li>
<li><code>--enable-unicode</code> &#8211; compile wxWidgets with unicode support</li>
</ul>
<p>When you are done choosing, enter the configure command. In my build, I used <code>../configure --enable-debug --disable-shared --enable-unicode</code>. After configure is done, it will output the basic options of your build</li>
<li>Run <code>make</code> to build wxWidgets. As this may take quite a while, you may consider doing 100 push-ups to burn the calories of that burrito you&#8217;ve just eaten while following this guide;</li>
<li>Remove object files with <code>rm *.o</code> (you&#8217;re not going to need them);</li>
<li>Run <code>make install</code> to install wxWidgets;</li>
</ol>
<p>This is it for compiling wxWidgets. Now you need to setup a C/C++ project on NetBeans to use what you&#8217;ve just compiled:</p>
<ol>
<li>First of all, make sure NetBeans recognizes your MinGW + MSYS setup. Go to <code>Tools --&gt; Options</code>, then select <code>C/C++</code>. Check if MinGW and MSYS bin subdirectories are listed on the current path list. Add them if they aren&#8217;t. <code>make</code> should be found inside MSYS while <code>gcc</code>, <code>g++</code> and <code>gdb</code> should be found inside MinGW;</li>
<li>Now that NetBeans recognizes your MinGW + MSYS setup, it&#8217;s time to create a new wxWidgets project. Go to <code>File --&gt; New Project...</code> and select <code>C/C++ application</code>;</li>
<li>With your project open, enter the project properties dialog;</li>
<li>Select <code>C/C++ --&gt; C++ Compiler --&gt; General options</code>;</li>
<li>Open the MSYS console and navigate to the directory where you&#8217;ve made your wxWidgets build (e.g. <code>build-static-debug</code>) and enter <code>wx-config --cxxflags.</code><code> wx-config</code> will output the compiler flags for your project. On my machine <code>wx-config --cxxflags</code> outputs <span> <code><span style="color: #0000ff;"> -I/c/wxWidgets-2.8.7/msw-debug/lib/wx/include/msw-uni<br />
code-debug-static-2.8 -I/c/wxWidgets-2.8.7/include -I/c/wxWidgets-2.8.7/contrib/include</span> <span style="color: #339966;">-D__WXDEBUG__ -D__WXMSW__ -mthreads</span></code></span>. Remember to leave this console open;</li>
<li>Add all directories <span style="color: #0000ff;">preppended with <code>-I</code></span> from <code>wx-config</code> output to the include directories of your project;</li>
<li>Select <code>Command line</code> and put the <span style="color: #339966;">remaining flags</span> from <code>wx-config</code> there;</li>
<li>Now select <code>Linker --&gt; General options</code>;</li>
<li>Back on the MSYS console, type <code>wx-config --libs</code>. <code>wx-config</code> will output the linker flags for your project. On my machine <code>wx-config --libs</code> outputs <code><span style="color: #0000ff;">-L/c/wxWidgets-2.8.7/msw-debug/lib</span> <span style="color: #008000;">-mthreads  -Wl,--subsystem,windows -mwindows </span><span style="color: #008000;">/c/wxWidgets-2.8.7/msw-debug/lib/libwx_mswud_richtext-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_mswud_aui-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_mswud_xrc-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_mswud_qa-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_mswud_html-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_mswud_adv-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_mswud_core-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_baseud_xml-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_baseud_net-2.8.a /c/wxWidgets-2.8.7/msw-debug/lib/libwx_baseud-2.8.a </span><span style="color: #008000;">-lwxregexud-2.8 -lwxexpatd-2.8 -lwxtiffd-2.8 -lwxjpegd-2.8 -lwxpngd-2.8 -lwxzlibd-2.8 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi3</span></code>;</li>
<li>Add the directory <span style="color: #0000ff;">preppended with <code>-L</code></span> to the <code>Additional library directories</code> inside <code>General options</code> and click OK to close this dialog;</li>
<li>Now select <code>Linker --&gt; Libraries --&gt; Add option... --&gt; Other option...;</code></li>
<li>Back on the MSYS console, copy the <span style="color: #008000;">remaining linker flags</span>;</li>
<li>Paste the <span style="color: #008000;">remaining flags</span> from <code>wx-config --libs</code> on your notepad and <strong>replace all occurrences of /c/ by C\:/</strong> (this letter may vary depending on where you installed wxWidgets), then paste the result on that field. Remember: replacing /c/ by C\:/ is utterly necessary if you don&#8217;t want to see ugly linker errors!;</li>
<li>Create a <a href="http://www.wxwidgets.org/docs/tutorials/hworld2.txt">simple wx program</a> and build it;</li>
</ol>
<p>That&#8217;s a lot of work for a first application, but for your next applications all you will have to do is to repeat the compiler and linker options. Now you can use your favorite IDE to make wxWidgets applications on Windows.</p>
<p>PS: A wxWidgets plugin for NetBeans (wxMatisse?) would be great.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daltonfilho.com/2008/02/23/wxwidgets-on-windows-using-netbeans-60-with-mingw-msys/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

