<span class="gmail_quote"><br><br></span>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Procedure for setup of a windows build environment for QGIS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tim Sutton and Godofredo Contreras 2006<br>&nbsp; With thanks to Tisham Dhar for preparing the initial msys environment</strong>
 <br>---------------------------------------------------------------------------------</p>
<p><font size="2">This document describes the process you need to follow to get QGIS built directly<br>under windows (rather than using a cross compiler under linux).</font><font size="2">Note: The process for building under windows is still being sorted out so 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check this document regularly for updates.</font></p>
<p><font size="2">Msys:<br>-----<br>get this: </font></p>
<p><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://qgis.org/uploadfiles/msys/msys.tar.bz2" target="_blank"><font size="2">http://qgis.org/uploadfiles/msys/msys.tar.bz2</font></a></p>
<div><font size="2">and unpack to c:\msys</font></div>
<div><font size="2">The file is compressed using bzip2 - you can get a free windows application<br>for creating and decompressing files here:</font></div>
<p><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.7-zip.org/" target="_blank"><font size="2">http://www.7-zip.org/</font></a></p>
<p><font size="2">Qt4.2:<br>------</font></p>
<p><font size="2">Download qt4.2 opensource precompiled edition exe and install (including the <br>download and install of mingw) from here:</font></p>
<p><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.trolltech.com/developer/downloads/qt/windows" target="_blank"><font size="2">http://www.trolltech.com/developer/downloads/qt/windows</font></a>
</p>
<p><font size="2">Edit C:\Qt\4.2.0\bin\qtvars.bat and add the following line (the second is only <br>needed if you like vim in your shell):</font></p>
<p><font size="2">set PATH=%PATH%;C:\msys\local\bin;c:\msys\local\lib<br>set PATH=%PATH%;&quot;c:\Program Files\Vim\vim70\</font></p>
<p><font size="2">If you plan to do some debugging, you&#39;ll need to complie debug version of Qt:<br>C:\Qt\4.2.0\bin\qtvars.bat compile_debug</font></p>
<p><br><font size="2">QGIS:<br>-----<br>Check out to c:\dev\cpp\qgis:</font></p>
<p><font size="2">cd c:\dev\cpp<br>svn co </font><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://svn.qgis.org/repos/qgis/trunk/qgis" target="_blank"><font size="2">https://svn.qgis.org/repos/qgis/trunk/qgis
</font></a></p>
<p><font size="2">Currently you need to put it into that location in case you plan to create<br>the NSIS installer because so far it contains hardcoded paths for this location.</font></p>
<p><br><font size="2">Source changes:<br>---------------</font></p>
<p><font size="2">Next you need to shift some files around. For convenience we&#39;ve made an archive<br>that handles all the changes for you. Download it and unpack to qgis source directory:</font></p>
<p><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://qgis.org/uploadfiles/msys/qgis-qmake-files.zip" target="_blank"><font size="2">http://qgis.org/uploadfiles/msys/qgis-qmake-files.zip</font></a></p>

<p><font size="2">List of what has been changed / added by this archive to enable compilation:</font></p>
<p><font size="2">&nbsp;- moved qgscsexception.h, qgsspatialrefsys* and qgscoordinatetransform* into core dir from gui<br>&nbsp;- moved qgspluginregistry.* from core to gui<br>&nbsp;- qgsspatialrefsys.cpp - commented out SRS validation using projection selector 
<br>&nbsp;- qgsspatialrefsys.cpp - commented out lines using qgsproject as it depends on gui stuff<br>&nbsp;- qgsdistancearea.cpp - commented out lines using qgsproject as it depends on <br>&nbsp;&nbsp; gui stuff and moved to core<br>&nbsp;- lexer and parser generated by 
genlexyacc.bat<br>&nbsp;- added custom qgsconfig.h and qgssvnversion.h</font></p>
<p><br><font size="2">Building:<br>---------</font></p>
<p><font size="2">Now open the qt command shell (or start &quot;cmd&quot; and run c:\Qt\4.2.0\bin\qtvars.bat)</font></p>
<p><font size="2">cd c:\dev\cpp\qgis<br>qmake<br>make</font></p>
<p><font size="2">This will compile both debug and release version. To make just a one of them<br>use &quot;make debug&quot; or &quot;make release&quot; respectively.</font></p>
<p><font size="2">Note: debug version uses debug version of Qt library thus if linking fails<br>on not founding library QtSvgd4 (or similar), you need to compile them<br>as described in section for Qt.</font></p>
<p><font size="2">Running: (optional)<br>--------</font></p>
<p><font size="2">After successfull make you can run QGIS directly from the directory<br>where it has been built: qgis-debug and/or qgis-release in qgis root dir.<br>You only need to add data files - we have provided an archive for convenience 
<br>which you can just unpack there and run QGIS:</font></p>
<p><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://qgis.org/uploadfiles/msys/qgis_data.zip" target="_blank"><font size="2">http://qgis.org/uploadfiles/msys/qgis_data.zip</font></a></p>
<p><font size="2">Then just run qgis.exe</font></p>
<p><font size="2">GDB: (optional)<br>----</font></p>
<p><font size="2">If you plan to do some debugging, download and install gdb-6.3.2.exe from </font></p>
<p><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://prdownloads.sourceforge.net/mingw/gdb-6.3-2.exe?download" target="_blank"><font size="2">http://prdownloads.sourceforge.net/mingw/gdb-6.3-2.exe?download
</font></a></p>
<p><font size="2">and install to c:\msys\mingw</font></p>
<p><br><font size="2">Create the installation package: (optional)<br>--------------------------------</font></p>
<p><font size="2">Downlad and install NSIS from (</font><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://nsis.sourceforge.net/Main_Page" target="_blank"><font size="2">http://nsis.sourceforge.net/Main_Page
</font></a><font size="2">)</font></p>
<p><font size="2">Download both the QGIS debug and release installer packages from </font></p>
<p><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://qgis.org/uploadfiles/testbuilds/" target="_blank"><font size="2">http://qgis.org/uploadfiles/testbuilds/</font></a></p>
<p><font size="2">and install them. Now copy the installation dirs from C:\Program Files\QGIS* into <br>c:\dev\cpp\qgis\qgis-debug and c:\dev\cpp\qgis\qgis-release respectively. After<br>making these copies uninstall the release and debug versions of QGIS from 
<br>your c:\Program Files directories using the provided uninstaller. Double check<br>that both dirs are complete gone under program files afterwards.</font></p>
<p><font size="2">Now using windows explorer, enter the c:\dev\cpp\qgis\win_build directory and right <br>click on qgis.nsi and choose the option &#39;Compile NSIS Script&#39;. Do the same <br>for qgis-debug.nsi. Congratulations you should have two installable qgis 
<br>setup files in the win_build directory now..</font></p>
<p><font size="2">&nbsp;</font></p>
<div><br><font color="#cc0000" size="4">I FOLLOWED THIS METHOD TO SETUP WINDOWS BUILD ENVIRONMENT FOR QGIS...BUT ENCOUNTERED WITH SOME PROBLEMS IN THE MIDDLE...</font></div>
<div><font color="#cc0000" size="4">1.after runnng make---errors due to missing of&quot;qgsconfig.h &amp;qgssvnversion.h&quot;</font></div>
<div><font color="#cc0000" size="4">where i can get it????</font></div>
<div><font color="#cc0000" size="4">&nbsp;</font></div>
<div><font color="#cc0000" size="4">pls help me.......<br clear="all"></font><br>-- <br>jaan </div><br clear="all"><br>-- <br>jaan