<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/2042/1/7/_/styles/combined.css?spaceKey=TOP&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Windows">Building - Windows</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~khunt">Ken Hunt</a>
    </h4>
        <br/>
                         <h4>Changes (8)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* Ice Third Party Libraries - [http://www.zeroc.com/download.html] <br>* Visual Studio C+\+ 2010 Express \-&amp;nbsp;[http://www.microsoft.com/express/Downloads/] or Visual Studio 2010 Professional <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* OpenSSL 0.9.8r - [http://www.slproweb.com/products/Win32OpenSSL.html] <br></td></tr>
            <tr><td class="diff-unchanged" >* Optional, for Java support <br>** Oracle&#39;s [Java Development Kit|http://www.oracle.com/technetwork/java/javase/downloads/index.html], Java SE 6 <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >bash gitall-asterisk-scf.sh <br>{noformat} <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Now you can decide between two methods to build Asterisk SCF itself. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Now you can decide between which method you want to use to build Asterisk SCF itself. <br></td></tr>
            <tr><td class="diff-changed-lines" >** Build using the Visual Studio IDE <span class="diff-added-words"style="background-color: #dfd;">or msbuild</span> (from a Visual Studio 2010 Command Prompt) <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>bash cmake\init-cmake.sh <br>{noformat} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Now</span> <span class="diff-added-words"style="background-color: #dfd;">* To build from within the Visual Studio IDE,</span> open Visual Studio and open the &quot;Asterisk SCF&quot; solution file generated by CMake in the &#39;build&#39; subdirectory of the &#39;gitall&#39; directory. You may seem some warnings about project files needing to be upgraded; if you do, let Visual Studio perform the upgrades. Once the solution is open, choose &quot;Build Solution&quot; from the &quot;Build&quot; menu, and the entire Asterisk SCF build will proceed. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* To build using msbuild: <br>{norformat} <br>cd build <br>msbuild AsteriskSCF.sln <br>{norformat} <br></td></tr>
            <tr><td class="diff-unchanged" >** Build from the command line (from a Visual Studio 2010 Command Prompt) <br>{noformat} <br>bash cmake\init-cmake.sh --nmake <br></td></tr>
            <tr><td class="diff-changed-lines" >cmake --build .\build <span class="diff-added-words"style="background-color: #dfd;">--config Debug</span> <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>** (java) Build Java bindings - see [Building Java components] <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h2. 64-bit Installation <br>{info}Forthcoming{info} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h2. Running Unit Tests <br>The unit tests can be run via CMake&#39;s CTest tool, or from within the Visual Studio IDE.  <br>* To run tests within Visual Studio, right-click the RUN_TESTS project of the AsteriskSCF solution, and select &#39;Build&#39;.  <br>* To run the tests from the command line, change directories in your Visual Studio 2010 Command Prompt to the build subdirectory of the gitall directory and invoke CTest for the type of build you performed. <br>{noformat} <br>cd build <br>ctest -C Debug <br>{noformat} <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="Building-Windows-Preface"></a>Preface</h2>

<p>These instructions explain how to build Asterisk SCF on a clean, updated, basic Windows installation. This process is for building native (unmanaged) C+&#43; components.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>All Asterisk SCF core components are implemented in C++. For developers who wish to build components in .NET languages, read <a href="/wiki/display/TOP/Building+.NET+Components+for+Asterisk+SCF" title="Building .NET Components for Asterisk SCF">Building .NET Components for Asterisk SCF</a>.</td></tr></table></div>


<h2><a name="Building-Windows-SoftwareRequirements"></a>Software Requirements</h2>

<ul>
        <li>Git for Windows - <a href="http://code.google.com/p/msysgit/" class="external-link" rel="nofollow">http://code.google.com/p/msysgit/</a>&nbsp;&#45; Don't download mSysGit; that is an environment for building Git from source.</li>
        <li>CMake - <a href="http://www.cmake.org/cmake/resources/software.html" class="external-link" rel="nofollow">http://www.cmake.org/cmake/resources/software.html</a></li>
        <li>LUA - <a href="http://code.google.com/p/luaforwindows/" class="external-link" rel="nofollow">http://code.google.com/p/luaforwindows/</a></li>
        <li>DirectX SDK - <a href="http://msdn.microsoft.com/en-us/directx/aa937788.aspx" class="external-link" rel="nofollow">http://msdn.microsoft.com/en-us/directx/aa937788.aspx</a></li>
        <li>BoostPro Libraries - <a href="http://www.boostpro.com/download/" class="external-link" rel="nofollow">http://www.boostpro.com/download/</a>&nbsp;&#45; Note that version 1.44.0 is the most recent version tested wtih Asterisk SCF, and there is at least one known problem with the version 1.46.1 installer.</li>
        <li>Ice Third Party Libraries - <a href="http://www.zeroc.com/download.html" class="external-link" rel="nofollow">http://www.zeroc.com/download.html</a></li>
        <li>Visual Studio C+&#43; 2010 Express &#45;&nbsp;<a href="http://www.microsoft.com/express/Downloads/" class="external-link" rel="nofollow">http://www.microsoft.com/express/Downloads/</a> or Visual Studio 2010 Professional</li>
        <li>OpenSSL 0.9.8r - <a href="http://www.slproweb.com/products/Win32OpenSSL.html" class="external-link" rel="nofollow">http://www.slproweb.com/products/Win32OpenSSL.html</a></li>
        <li>Optional, for Java support
        <ul>
                <li>Oracle's <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" class="external-link" rel="nofollow">Java Development Kit</a>, Java SE 6</li>
                <li><a href="http://ant.apache.org" class="external-link" rel="nofollow">Apache Ant</a></li>
        </ul>
        </li>
</ul>


<h2><a name="Building-Windows-32bitInstallation"></a>32-bit Installation</h2>

<ul>
        <li><h6><a name="Building-Windows-GitforWindows"></a>Git for Windows</h6>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>For convenience, enable the 'Windows Explorer integration' and 'Context menu entries' options; they will allow you to easily open a bash shell in any folder you can navigate to.&nbsp;
<br class="atl-forced-newline" />
Select the 'Run Git and included Unix tools from the Windows Command Prompt' option so that Git and bash will be in your PATH.</td></tr></table></div></li>
        <li><h6><a name="Building-Windows-CMake"></a>CMake</h6>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>By default, you will be able to run CMake as a GUI application from the Start menu. If you'd also like to be able to run CMake from the command line, select either 'Add CMake to the system PATH for all users' or 'Add CMake to the system PATH for the current user', depending on your preference.</td></tr></table></div></li>
        <li><h6><a name="Building-Windows-LUA"></a>LUA</h6>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>You can deselect all the optional packages in the installer except for 'Lua Module Development files'.</td></tr></table></div></li>
        <li><h6><a name="Building-Windows-DirectXSDK"></a>DirectX SDK</h6></li>
        <li><h6><a name="Building-Windows-BoostProLibraries"></a>BoostPro Libraries</h6>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Select 'Visual C+&#43; 10.0 (Visual Studio 2010)' as the compiler and the 'Multithreaded DLL'  and 'Multithreaded Debug DLL' variants to install. On the 'Components' page, deselect 'Source and Documentation' to save some download time and disk space (the source is not necessary, and the complete documentation is available online).</td></tr></table></div></li>
        <li><h6><a name="Building-Windows-IceThirdPartyLibraries"></a>Ice Third Party Libraries</h6>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>After the installation, you will need to add 'C:\Program Files\ZeroC\Ice-3.4.1-ThirdParty\bin\vc100' to your system's PATH.</td></tr></table></div></li>
        <li><h6><a name="Building-Windows-%28java%29ApacheAnt"></a>(java) Apache Ant</h6>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Extract the <tt>apache-ant-VERSION.zip</tt> file to wherever you wish.  Set the environment variable <tt>ANT_HOME</tt> to the extracted copy of Ant, and add <tt>%ANT_HOME%\bin</tt> to your path.  Also set the environment variable <tt>JAVA_HOME</tt> to point to your JDK installation.</td></tr></table></div></li>
        <li><h6><a name="Building-Windows-Digium%27sIceDistribution%28fromaVisualStudio2010CommandPrompt%29"></a>Digium's Ice Distribution (from a Visual Studio 2010 Command Prompt)</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd &lt;YOURBUILDDIR&gt;
git clone git://git.asterisk.org/asterisk-scf/release/ice
set CPP_COMPILER=VC100_EXPRESS (if you are using VS2010 Express)
set CPP_COMPILER=VC100 (if you are using VS2010 Professional)
cd ice\cpp\src
nmake -f Makefile.mak
cd ..
nmake -f Makefile.mak install
</pre>
</div></div>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>By default, the Ice build produces 'debug' libraries and binaries. This means that you will only be able to produce 'debug' components during the Asterisk SCF build process, as the library type (release or debug) must match. If you wish to be able to produce 'release' components of Asterisk SCF, then you'll also need to produce a 'release' build of Ice; you can do that by editing the ice\cpp\config\Make.rules.mak file and uncommenting the line that disables optimization ("OPTIMIZE = yes").</td></tr></table></div>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>If you are using Visual Studio Express, not Visual Studio Professional, and you try build <b>all</b> of the Ice C++ mapping (including demos and self tests), you will receive an error when the system attempts to build the "MFC" demos for Ice. This occurs because Visual Studio Express does not include MFC. Unless you need to use this specific demo for some purpose, though, you can ignore this error and complete the Ice installation.</td></tr></table></div>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>After the installation, you will need to add 'C:\Ice-3.4.1\bin' to your system's PATH.</td></tr></table></div></li>
        <li><h6><a name="Building-Windows-%28java%29IceforJava%28fromaVisualStudio2010CommandPrompt%29"></a>(java) Ice for Java (from a Visual Studio 2010 Command Prompt)</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd &lt;YOURBUILDDIR&gt;\ice\java
nmake -f Makefile.mak all install
</pre>
</div></div></li>
        <li><h6><a name="Building-Windows-Digium%27sSliceTranslatorPlugins%28fromaVisualStudio2010CommandPrompt%29"></a>Digium's Slice Translator Plugins (from a Visual Studio 2010 Command Prompt)</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd &lt;YOURBUILDDIR&gt;
git clone git://git.asterisk.org/asterisk-scf/release/slice-plugins
cd slice-plugins
cmake -G "NMake Makefiles" .
nmake
nmake install
</pre>
</div></div></li>
        <li><h6><a name="Building-Windows-AsteriskSCF%28fromaVisualStudio2010CommandPrompt%29"></a>Asterisk SCF (from a Visual Studio 2010 Command Prompt)</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd &lt;YOURBUILDDIR&gt;
git clone git://git.asterisk.org/asterisk-scf/integration/gitall
cd gitall
bash gitall-asterisk-scf.sh
</pre>
</div></div>
<p>Now you can decide between which method you want to use to build Asterisk SCF itself.</p>
        <ul>
                <li>Build using the Visual Studio IDE or msbuild (from a Visual Studio 2010 Command Prompt)
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>bash cmake\init-cmake.sh
</pre>
</div></div></li>
        </ul>
        </li>
        <li>To build from within the Visual Studio IDE, open Visual Studio and open the "Asterisk SCF" solution file generated by CMake in the 'build' subdirectory of the 'gitall' directory. You may seem some warnings about project files needing to be upgraded; if you do, let Visual Studio perform the upgrades. Once the solution is open, choose "Build Solution" from the "Build" menu, and the entire Asterisk SCF build will proceed.</li>
        <li>To build using msbuild:
<div class="error"><span class="error">Unknown macro: {norformat}</span> 
<p>cd build<br/>
msbuild AsteriskSCF.sln</p></div>
        <ul>
                <li>Build from the command line (from a Visual Studio 2010 Command Prompt)
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>bash cmake\init-cmake.sh --nmake
cmake --build .\build --config Debug
</pre>
</div></div></li>
                <li>(java) Build Java bindings - see <a href="/wiki/display/TOP/Building+Java+components" title="Building Java components">Building Java components</a></li>
        </ul>
        </li>
</ul>


<h2><a name="Building-Windows-64bitInstallation"></a>64-bit Installation</h2>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Forthcoming</td></tr></table></div>

<h2><a name="Building-Windows-RunningUnitTests"></a>Running Unit Tests</h2>
<p>The unit tests can be run via CMake's CTest tool, or from within the Visual Studio IDE. </p>
<ul>
        <li>To run tests within Visual Studio, right-click the RUN_TESTS project of the AsteriskSCF solution, and select 'Build'.</li>
        <li>To run the tests from the command line, change directories in your Visual Studio 2010 Command Prompt to the build subdirectory of the gitall directory and invoke CTest for the type of build you performed.
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd build
ctest -C Debug
</pre>
</div></div></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Windows">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=6586426&revisedVersion=46&originalVersion=45">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Windows?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>