Difference between revisions of "WxHaskell/Building on Windows"

From HaskellWiki
Jump to navigation Jump to search
 
Line 1: Line 1:
  +
#REDIRECT [[WxHaskell/Windows]]
 
=== Building wxWidgets and wxc with Microsoft Visual C++ ===
 
 
The advantage of using Visual C++ is that the resulting libraries are smaller and faster than the gnu compiled ones. Furthermore, the debug version provides for automatic detection of memory leaks in the wxWidgets libraries and you get a warning when forgetting to deallocate wxWidgets objects. The drawback is that the configure scripts are not used and you will need to set some options manually.
 
 
If you want to use Visual C++ Express Edition, you must use Visual C++ 2008 Express Editions or higher. Because previous version requires [http://msdn2.microsoft.com/express/aa700755.aspx installing Microsoft Platform SDK] before building wxWidgets or wxHaskell.
 
 
We use the wxWidgets provided workspace directly:
 
 
* '''wxWidgets 2.4''': Open the <tt>$wxwin/src/wxWidgets.dsw</tt> workspace. Select menu &quot;<tt>Build/Set active configuration</tt>&quot; and select &quot;<tt>wxWidgets - win32 release unicode</tt>&quot; to build the (static) library. After compilation, you can also select &quot;<tt>wxWidgets - win32 debug unicode</tt>&quot; to build the debug version.
 
* '''wxWidgets 2.6''': Open the <tt>$wxwin/build/msw/wx.dsw</tt> workspace. Select menu &quot;<tt>Build/Batch build</tt>&quot; and select all configurations by using the mouse and the <tt>shift</tt> key, when you click a marker, all configurations are deselected. Next you manually select the &quot;Unicode Release&quot; and &quot;Unicode Debug&quot; versions of all projects and press &quot;Build&quot;. Afterwards, press &quot;Save All&quot; to save all your mouse clicking work :-)
 
If you want to use [http://wxhaskell.sourceforge.net/doc/Graphics.UI.WXCore.Db.html database access] and [http://wxhaskell.sourceforge.net/doc/Graphics.UI.WXCore.OpenGL.html openGL canvas], you must edit <tt>$wxwin/include/msw/setup.h</tt>'s <tt>#define wxUSE_*</tt>(* is target feature name) from 0 to 1.
 
 
After building wxWidgets, you need to run <tt>configure</tt> for the wxHaskell library.
 
 
<pre>&gt; cd $wxhaskell
 
&gt; ./configure --with-msc</pre>
 
If you want to use the debug version of the library, use the <tt>--wxc-libname</tt> option too.
 
 
<pre>&gt; ./configure --with-msc --wxc-libname=wxcd</pre>
 
After configuration, first run <tt>make</tt> command to generate stc_gen.* files.
 
 
<pre>&gt; make</pre>
 
Make will stop by following error.
 
 
<pre>&gt; make: *** No rule to make target `out/wxc/wxc-msw2.6.4-0.10.1.dll', needed by `wxc'. Stop.</pre>
 
Then go <tt>$wxhaskell/wxc</tt> directory. Here, you need to adapt the <tt>wxc-&lt;em&gt;version&lt;/em&gt;.dsp</tt> project to reference the correct wxWidgets directory. Open the <tt>.dsp</tt> file in an editor and replace all occurrences of &quot;<tt>..\..\wxWindows-2.4.2</tt>&quot; (or &quot;<tt>..\..\wxWindows-2.6.4</tt>&quot;) or by the installed wxWidgets directory, i.e. <tt>$wxwin</tt>.
 
 
After adapting the project file, you can open the workspace <tt>wxc/wxc-&lt;em&gt;version&lt;/em&gt;.dsw</tt> and build the release and debug versions of the C wrapper library (if you use wxWidgets 2.6.4, you must choose &quot;Unicode Release&quot; or &quot;Unicode Debug&quot; instead of choosing just &quot;Release&quot; or &quot;Debug&quot;).
 
 
And finally! – you can run <tt>make</tt> in the <tt>$wxhaskell</tt> directory to build the Haskell libraries.
 
 
<pre>&gt; cd $wxhaskell
 
&gt; make
 
&gt; make install
 
&gt; make wx
 
&gt; make wx-install</pre>
 
[[Category:wxHaskell]]
 

Revision as of 20:05, 5 August 2008

Redirect to: