In Memoriam: Tai'lahr

OpenUru.org, along with the rest of the Mystonline community, is mourning the loss of Tai'lahr on October 16th, 2019.

Rest in Peace, friend.

Difference between revisions of "Build the client with MSVC 2010 Express"

From OpenUru
Jump to navigation Jump to search
m (Clarified libogg/libvorbis setup instructions)
(Remove most of the source changes needed for VS2010 after changing repository head to include those changes.)
 
(19 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
== Introduction ==
 
== Introduction ==
 
This document provides steps to build the CWE client with MSVC 2010 SP1 Express.
 
This document provides steps to build the CWE client with MSVC 2010 SP1 Express.
<BR>
 
  
 
== Before you begin ==
 
== Before you begin ==
Line 12: Line 11:
 
See [[Build the client with MSVC 2010 Express|Build preparation steps]] for installation instructions!
 
See [[Build the client with MSVC 2010 Express|Build preparation steps]] for installation instructions!
 
* [https://git-scm.com/download/win git] (recommended but not required)
 
* [https://git-scm.com/download/win git] (recommended but not required)
* [https://foundry.openuru.org/gitblit/summary/?r=CWE-ou.git The CWE OpenUru source code]
+
* [https://foundry.openuru.org/gitblit/summary/?r=CWE-ou.git The CWE OpenUru source code] - this does not include the Python code, which can be found in the [https://foundry.openuru.org/gitblit/summary/?r=MOULSCRIPT-ou.git MOULSCRIPT repo]
 
* [https://www.microsoft.com/en-us/download/details.aspx?id=6812 DirectX 9.0c SDK (June 2010)]
 
* [https://www.microsoft.com/en-us/download/details.aspx?id=6812 DirectX 9.0c SDK (June 2010)]
 
* [https://my.visualstudio.com/Downloads?q=visual%20studio%202010&wt.mc_id=o~msft~vscom~older-downloads Microsoft Visual Studio 2010 SP1 Express] - This will be in two downloads, you'll need to search for and download both "Visual Studio 2010 VC Express" and "Visual Studio 2010 Service Pack 1".
 
* [https://my.visualstudio.com/Downloads?q=visual%20studio%202010&wt.mc_id=o~msft~vscom~older-downloads Microsoft Visual Studio 2010 SP1 Express] - This will be in two downloads, you'll need to search for and download both "Visual Studio 2010 VC Express" and "Visual Studio 2010 Service Pack 1".
Line 28: Line 27:
 
* You can upgrade to a newer version of Speex if you like, but you will need to fix the Speex VS2010 projects first (by removing the architectures we do not have from the Speex project files).
 
* You can upgrade to a newer version of Speex if you like, but you will need to fix the Speex VS2010 projects first (by removing the architectures we do not have from the Speex project files).
 
* Libogg 1.3.2 was used because xiph removed the VS2010 projects from 1.3.3 and above.
 
* Libogg 1.3.2 was used because xiph removed the VS2010 projects from 1.3.3 and above.
* The client has physics bugs (cannot step off the Kadish elevator, and such) when compiled with PhysX 2.6.4 (the only available version).  If you can obtain it, PhysX 2.6.0 is the version Cyan used, and clients compiled with it do not seem to have these physics bugs.
 
 
* You must use a 2.6.x version of PhysX for CWE, because the cooked mesh format was changed in PhysX 2.7.x and later.
 
* You must use a 2.6.x version of PhysX for CWE, because the cooked mesh format was changed in PhysX 2.7.x and later.
 
* All libraries are compiled with "Whole Program Optimization" turned off.
 
* All libraries are compiled with "Whole Program Optimization" turned off.
 
* Release version libraries are compiled as "Multi-threaded DLL (/MD)"
 
* Release version libraries are compiled as "Multi-threaded DLL (/MD)"
 
* Debug version libraries are compiled as "Multi-threaded Debug DLL (/MDd)"
 
* Debug version libraries are compiled as "Multi-threaded Debug DLL (/MDd)"
* Crypto keys are located in "CWE\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\NucleusLib\pnNetBase".  Edit the *.hpp files with a text editor to replace Cyan's keys with your own server's keys.  Always clean your solution and rebuild when you change crypto keys, to make sure they are updated.<BR>
+
* Crypto keys are located in "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\NucleusLib\pnNetBase".  Edit the *.hpp files with a text editor to replace Cyan's keys with your own server's keys.  Always clean your solution and rebuild when you change crypto keys, to make sure they are updated.
 
 
 
* Server hostnames, IP addresses, and ports are located in the following files:
 
* Server hostnames, IP addresses, and ports are located in the following files:
<u>The status URL: </u><BR>
+
: <u>The status URL:</u>
"CWE\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp"<BR>
+
:: "CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp"
"CWE\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Main.cpp"<BR><BR>
+
:: "CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Main.cpp"
<u>The auth/gatekeeper address</u><BR>
+
: <u>The auth/gatekeeper address</u>
"CWE\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbSrvs.cpp"<BR><BR>
+
:: "CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbSrvs.cpp"
<u>The default client port</u><BR>
+
: <u>The default client port</u>
"CWE\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnNetBase/pnNbConstant.h"<BR><BR>
+
:: "CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnNetBase/pnNbConstant.h"
  
 
== Build preparation steps ==
 
== Build preparation steps ==
<ul>
+
 
<li>(Optional) install git (accepting the default options)</li>
+
=== git (Optional) ===
<li>Obtain CWE-OU source by one of these methods:
+
If you plan to make changes to the source code and contribute to the community, install git (accepting the default options).
<ul>
+
 
  <li> Use '''git clone''' with the repository link found on the webpage referenced above</li>
+
=== CWE-ou ===
  <li> Click "tree" in the top menu of the webpage reference above, then click "zip" to download a ZIP archive</li>
+
Obtain CWE-OU source by one of these methods:
</ul>
+
* Use '''git clone''' with the repository link found on the webpage referenced above
</li>
+
* Click "tree" in the top menu of the webpage reference above, then click "zip" to download a ZIP archive
<li>Install the DirectX 9.0c SDK and copy it to "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\DX9.0c".<BR>
+
 
Install the DirectX SDK before you install VS2010 Express, or the DirectX SDK install will throw error S1023, due to a newer version of the C++ 2010 redistributables being installed.<BR><BR>
+
=== DirectX ===
Directory structure in the CWE tree will look like this:
+
<p>Install the DirectX 9.0c SDK and copy it to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\DX9.0c".</p>
 +
<p>Install the DirectX SDK before you install VS2010 Express, or the DirectX SDK install will throw error S1023, due to a newer version of the C++ 2010 redistributables being installed.</p>
 +
<p>Directory structure in the CWE tree will look like this:
 
<pre>
 
<pre>
 
   StaticSDKs
 
   StaticSDKs
Line 63: Line 62:
 
         Lib
 
         Lib
 
</pre>
 
</pre>
</li>
+
</p>
<li> Install Visual Studio 2010 Express</li>
+
 
<li> Update Visual Studio 2010 Express to SP1, plus security updates (run Windows Update a few times).</li>
+
=== Visual Studio 2010 Express ===
<li> Copy the include and lib directories from the SDK installed with VS2010 SP1 Express to "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PlatformSDK". The directory where the SDK resides will most likely be "Program Files (x86)\Microsoft SDKs\Windows\v7.0A". As the SDK is in our path, this step is probably not necessary but we will do it for consistency.<BR><BR>
+
 
Directory structure in the CWE tree will look like this:
+
* Install Visual Studio 2010 Express
 +
* Install Service Pack 1 (SP1) for Visual Studio 2010, plus security updates (run Windows Update a few times)
 +
* Copy the include and lib directories from the SDK installed with VS2010 SP1 Express to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PlatformSDK". The directory where the SDK resides will most likely be "Program Files (x86)\Microsoft SDKs\Windows\v7.0A". As the SDK is in our path, this step is probably not necessary but we will do it for consistency.
 +
<p>Directory structure in the CWE tree will look like this:
 
<pre>
 
<pre>
 
StaticSDKs
 
StaticSDKs
Line 74: Line 76:
 
       include
 
       include
 
       lib</pre>
 
       lib</pre>
</li>
+
</p>
<li>Install the OpenAL SDK and copy the include and lib directories to "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK"<BR><BR>
+
 
Directory structure in the CWE tree will look like this:
+
=== OpenAL SDK ===
 +
Install the OpenAL SDK and copy the include and lib directories to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK"
 +
<p>Directory structure in the CWE tree will look like this:
 
<pre>
 
<pre>
 
   StaticSDKs
 
   StaticSDKs
Line 84: Line 88:
 
         libs
 
         libs
 
</pre>
 
</pre>
</li>
+
</p>
<li>Install PhysX SDK, and copy PhysX subdirectories from "Program Files (x86)\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\SDKs" and "Program Files (x86)\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\Bin" to "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PhysX"<BR><BR>
+
 
Directory structure in the CWE tree will look like this:
+
=== PhysX SDK ===
 +
Install PhysX SDK, and copy PhysX subdirectories as follows:
 +
* Copy from "Program Files (x86)\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\SDKs" to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PhysX"
 +
* Copy from and "Program Files (x86)\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\Bin" to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PhysX"
 +
<p>Directory structure in the CWE tree will look like this:
 
<pre>
 
<pre>
 
   StaticSDKs
 
   StaticSDKs
Line 98: Line 106:
 
         lib
 
         lib
 
         ...</pre>
 
         ...</pre>
</li>
+
</p>
<BR>
+
 
<li> Build Ogg and Vorbis</li>
+
=== libogg and libvorbis ===
 +
 
 +
Build Ogg and Vorbis
 
<ol style="list-style-type:lower-latin">
 
<ol style="list-style-type:lower-latin">
<li> Create a directory and extract Ogg and Vorbis archives to it.
+
<li>Create a directory and extract Ogg and Vorbis archives to it.
 
<pre>
 
<pre>
 
oggvorbis
 
oggvorbis
Line 108: Line 118:
 
   libvorbis-1.3.6</pre>
 
   libvorbis-1.3.6</pre>
 
</li>
 
</li>
<li> Change directory to "libvorbis-1.3.6\win32\vs2010" and edit the libogg.props file.  Make sure the "LIBOGG_VERSION" value matches your version of Ogg (1.3.2 in this document).</li>
+
<li>Change directory to "libvorbis-1.3.6\win32\vs2010" and edit the libogg.props file.  Make sure the "LIBOGG_VERSION" value matches your version of Ogg (1.3.2 in this document).</li>
<li> Open "libogg-1.3.2\win32\VS2010\libogg_static.sln" in the Visual Studio IDE.</li>
+
<li>Open "libogg-1.3.2\win32\VS2010\libogg_static.sln" in the Visual Studio IDE and perform the following steps:</li>
<li> On the IDE toolbar, click on configuration drop down at the upper left (it defaults to "Debug") and change it to "Release"</li>
+
<ol style="list-style-type:lower-latin">
<li> Right click on the project ("libogg_static") in the Solution Explorer at upper left, and select Properties.</li>
+
<li>On the IDE toolbar, click on configuration drop down at the upper left (it defaults to "Debug") and change it to "Release"</li>
<li> In the "libogg_static Properties Pages" panel that opens, select "Configuration Properties -> General " in the left pane, and then select "Whole Program Optimization" in the right pane, and select "No Whole Program Optimization" from the drop-down.</li>
+
<li>Right click on the project (e.g. "libogg_static") in the Solution Explorer at upper left, and select Properties.</li>
<li> Select "C/C++ -> Optimization" in the left pane, and set "Whole Program Optimization" in the right pane to "No".
+
<li>In the panel that opens, set (or verify) the following items as follows:
<li> Select "C/C++ -> Code Generation" in the left pane, and select "Runtime Library" and verify it is set to "Multi-threaded DLL (/MD)"</li>
+
{| class="wikitable"
<li> Click on "Apply"</li>
+
!Left Pane
<li> Click on configuration drop down at the upper left of the "libogg_static Properties Pages" panel and select "Debug"</li>
+
!Right pane parameter
<li> Select "Configuration Properties -> General" in the left pane, and then select "Whole Program Optimization" in the right pane, and verify it is set to "No Whole Program Optimization".</li>
+
!Right pane value (drop down)
<li> Select "C/C++ -> Optimization" in the left pane, and verify "Whole Program Optimization" in the right pane is set to "No".
+
|-
<li> Select "C/C++ -> Code Generation" in the left pane, and select "Runtime Library" and set it to "Multi-threaded Debug DLL (/MDd)"</li>
+
|Configuration Properties -> General
<li> Click "Apply" and then "OK". </li>
+
|Whole Program Optimization
<li> On the IDE toolbar, verify the configuration drop down is still set to "Release". Then right click on the project in the solution explorer and select "Build". </li>
+
|No Whole Program Optimization
<li> On the IDE toolbar, select "Debug" from the drop down. Then right click on the project in the solution explorer and select "Build". </li>
+
|-
<li> Open "libvorbis-1.3.6\win32\VS2010\vorbis_static.sln" in the Visual Studio IDE. </li>
+
|C/C++ -> Optimization
<li> Repeat steps "d" through "n" for projects libvorbis_static and libvorbisfile. </li>
+
|Whole Program Optimization
 +
|No
 +
|-
 +
|C/C++ Code Generation
 +
|Runtime Library
 +
|Multi-threaded DLL (/MD)
 +
|}
 +
<li>Click on "Apply"</li>
 +
<li>Click on configuration drop down at the upper left of the panel and select "Debug". Set (or verify) the following items as follows, noting that the 3rd item is not the same as in the previous list.</li>
 +
{| class="wikitable"
 +
!Left Pane
 +
!Right pane parameter
 +
!Right pane value (drop down)
 +
|-
 +
|Configuration Properties -> General
 +
|Whole Program Optimization
 +
|No Whole Program Optimization
 +
|-
 +
|C/C++ -> Optimization
 +
|Whole Program Optimization
 +
|No
 +
|-
 +
|C/C++ Code Generation
 +
|Runtime Library
 +
|Multi-threaded Debug DLL (/MDd)
 +
|}
 +
</li>
 +
<li>Click "Apply" and then "OK". </li>
 +
<li>On the IDE toolbar, verify the configuration drop down is still set to "Release". Then right click on the project in the solution explorer and select "Build". </li>
 +
<li>On the IDE toolbar, select "Debug" from the drop down. Then right click on the project in the solution explorer and select "Build".</li>
 +
</ol>
 +
<li>Open "libvorbis-1.3.6\win32\VS2010\vorbis_static.sln" in the Visual Studio IDE, and repeat the preceding steps for projects libvorbis_static and libvorbisfile.</li>
 
</ol>
 
</ol>
<li> Copy Ogg and Vorbis files to CWE </li>
+
 
 +
Copy Ogg and Vorbis files to CWE
 
<ol style="list-style-type:lower-latin">
 
<ol style="list-style-type:lower-latin">
 
+
<li>Copy the ogg and vorbis include directories into "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\include".  It is okay to let it overwrite.
<li> Copy the ogg and vorbis include directories into "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\include".  It is okay to let it overwrite.
+
<li> Copy the "libogg-1.3.2\win32\VS2010\Win32\Release" and "Debug" directories into "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib"</li>
<li> Copy the "libogg-1.3.2\win32\VS2010\Win32\Release" and "Debug" directories into "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib"</li>
+
<li> Copy the "libvorbis-1.3.6\win32\VS2010\Win32\Release" and "Debug" directories to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib"</li>
<li> Copy the "libvorbis-1.3.6\win32\VS2010\Win32\Release" and "Debug" directories to "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib"</li>
+
</ol>
Directory structure in the CWE tree will look like this:
+
<p>Directory structure in the CWE tree will look like this:
 
<pre>
 
<pre>
 
   StaticSDKs
 
   StaticSDKs
Line 143: Line 185:
 
           Debug
 
           Debug
 
           Release</pre>
 
           Release</pre>
 +
</p>
 +
 +
=== Speex ===
 +
 +
Rebuild the Speex 1.0.1 included in the CWE tree.
 +
<ol style="list-style-type:lower-latin">
 +
<li>Open CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\libspeex.sln in the Visual Studio 2010 IDE, and convert.</li>
 +
<li>Click on configuration drop-down on the upper left and select "Release"</li>
 +
<li>Right click on project in the solution explorer and select properties.</li>
 +
<li>In the panel that opens, set (or verify) the following items as follows:
 +
{| class="wikitable"
 +
!Left Pane
 +
!Right pane parameter
 +
!Right pane value (drop down)
 +
|-
 +
|Configuration Properties -> General
 +
|Whole Program Optimization
 +
|No Whole Program Optimization
 +
|-
 +
|C/C++ -> Optimization
 +
|Whole Program Optimization
 +
|No
 +
|-
 +
|C/C++ Code Generation
 +
|Runtime Library
 +
|Multi-threaded DLL (/MD)
 +
|}
 +
<li>Click on "Apply".</li>
 +
<li>Click on configuration drop-down on the upper left of the properties page and select "Debug". Set (or verify) the following items as follows, noting that the 3rd item is not the same as in the previous list.</li>
 +
{| class="wikitable"
 +
!Left Pane
 +
!Right pane parameter
 +
!Right pane value (drop down)
 +
|-
 +
|Configuration Properties -> General
 +
|Whole Program Optimization
 +
|No Whole Program Optimization
 +
|-
 +
|C/C++ -> Optimization
 +
|Whole Program Optimization
 +
|No
 +
|-
 +
|C/C++ Code Generation
 +
|Runtime Library
 +
|Multi-threaded Debug DLL (/MDd)
 +
|}
 
</li>
 
</li>
</ol>
 
<li>Rebuild the Speex 1.0.1 included in the CWE tree.</li>
 
<ol style="list-style-type:lower-latin">
 
<li>Open CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\libspeex.sln in the Visual Studio 2010 IDE, and convert.</li>
 
<li> Click on configuration drop-down on the upper left and select "Release"</li>
 
<li> Right click on project in the solution explorer and select properties.</li>
 
<li> Select "Configuration Properties -> General " in the left pane, and then select "Whole Program Optimization" in the right pane, and select "No Whole Program Optimization" from the drop-down.</li>
 
<li> Select "C/C++ -> Optimization" in the left pane, and set "Whole Program Optimization" in the right pane to "No".
 
<li> Select "C/C++ -> Code Generation" in the left pane, and select "Runtime Library" and verify it is set to "Multi-threaded DLL (/MD)"</li>
 
<li> Click on "Apply"</li>
 
<li> Click on configuration drop-down on the upper left of the properties page and select "Debug"</li>
 
<li> Select "Configuration Properties -> General" in the left pane, and then select "Whole Program Optimization" in the right pane, and select "No Whole Program Optimization" from the drop-down.</li>
 
<li> Select "C/C++ -> Code Generation" in the left pane, and select "Runtime Library" and verify it is set to "Multi-threaded Debug DLL (/MDd)"</li>
 
 
<li> Click "Apply" and then "OK". </li>
 
<li> Click "Apply" and then "OK". </li>
<li> On the IDE toolbar, select "Release" from the drop down. then right click on the project in the solution explorer and select "Build". </li>
+
<li> On the IDE toolbar, select "Release" from the drop down. then right click on the project in the solution explorer and select "Build".</li>
<li> On the IDE toolbar, select "Debug" from the drop down. then right click on the project in the solution explorer and select "Build". </li>
+
<li> On the IDE toolbar, select "Debug" from the drop down. then right click on the project in the solution explorer and select "Build".</li>
<li>Copy the headers (.h files) from CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\libspeex to CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\include\speex</li>
+
<li>Copy the headers (.h files) from CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\libspeex to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\include\speex</li>
<li> Copy CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\Release\libspeex.lib to CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib\Release</li>
+
<li> Copy CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\Release\libspeex.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib\Release</li>
<li> Copy CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\Debug\libspeex.lib to CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib\Debug</li>
+
<li> Copy CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\Debug\libspeex.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib\Debug</li>
 
</ol>
 
</ol>
<li>Compile and install OpenSSL (see [[Build OpenSSL with MS Visual C++]]), or obtain precompiled binaries.  As this is security software, it is best (in my opinion) to compile it yourself from source.  You can choose either static or dynamic linking.<BR>  '''Note:''' If you link it dynamically, it will cause the Uru client to require the OpenSSL DLLs to be present in the client directory or in the system path.<BR><BR> Copy the installed OpenSSL files to "CWE\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenSSL".<BR><BR>
+
 
Directory structure in the CWE tree will look like this:
+
=== OpenSSL ===
 +
<p>Compile and install OpenSSL (see [[Build OpenSSL with MS Visual C++]]), or obtain [https://wiki.openssl.org/index.php/Binaries precompiled binaries] (32-bit, not 64-bit).</p>
 +
<p>If compiling it yourself, you can choose either static or dynamic linking. '''Note:''' If you link it dynamically, it will cause the Uru client to require the OpenSSL DLLs to be present in the client directory or in the system path.</p>
 +
<p>Copy the installed OpenSSL files to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenSSL".</p>
 +
<p>Directory structure in the CWE tree will look like this:
 
<pre>
 
<pre>
 
   StaticSDKs
 
   StaticSDKs
Line 174: Line 253:
 
           openssl
 
           openssl
 
         lib</pre>
 
         lib</pre>
</li>
+
</p>
<li>Build in-tree JPEG library</li>
+
 
 +
=== JPEG ===
 +
Build in-tree JPEG library
 
<ol style="list-style-type:lower-latin">
 
<ol style="list-style-type:lower-latin">
<li>Open "Visual Studio 2010 Command Prompt" and change to the "CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\jpeg-8c-rgba directory."</li>
+
<li>Open "Visual Studio Command Prompt (2010)" and change to the "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\jpeg-8c-rgba directory."</li>
 
<li>Copy makefile.vc to makefile.nmake</li>
 
<li>Copy makefile.vc to makefile.nmake</li>
 
<li>Copy jconfig.vc to jconfig.h</li>
 
<li>Copy jconfig.vc to jconfig.h</li>
 
<li>Run ''nmake nodebug=1 -f makefile.nmake''.  This will build the library in non-debug mode.  If you use a debug library, the linker will complain when we link the client executable.</li>
 
<li>Run ''nmake nodebug=1 -f makefile.nmake''.  This will build the library in non-debug mode.  If you use a debug library, the linker will complain when we link the client executable.</li>
 
</ol>
 
</ol>
<li>Build zlib and libpng</li>
+
 
 +
=== zlib and libpng ===
 +
Build zlib and libpng
 
<ol style="list-style-type:lower-latin">
 
<ol style="list-style-type:lower-latin">
 
<li>Extract the files in the zlib archive to ''MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/zlib''.</li>
 
<li>Extract the files in the zlib archive to ''MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/zlib''.</li>
 
<li>Extract the files in the libpng archive to ''MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/png''.</li>
 
<li>Extract the files in the libpng archive to ''MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/png''.</li>
 +
<li>Edit the ''png/projects/vstudio/zlib.props'' file. Towards the bottom is a path for ZLibSrcDir. Change the value to "..\..\..\..\zlib" (no -1.2.5 or such on the end) and save the file.</li>
 
<li>Open ''png/projects/vstudio/vstudio.sln'' in the Visual Studio 2010 IDE.</li>
 
<li>Open ''png/projects/vstudio/vstudio.sln'' in the Visual Studio 2010 IDE.</li>
 +
<li>On the IDE toolbar, click on the configuration drop down at the upper left (it defaults to "Debug") and change it to "Release Library".</li>
 
<li>The VS2010 zlib project file distributed in the png archive is set to build for embedded environments.  We need to reconfigure it.</li>
 
<li>The VS2010 zlib project file distributed in the png archive is set to build for embedded environments.  We need to reconfigure it.</li>
 
<ol style="list-style-type:lower-latin">
 
<ol style="list-style-type:lower-latin">
<li>Right click on the zlib project tree in the solution explorer.</li>
+
<li>Right click on the zlib project tree in the solution explorer and select "Add > Existing item"</li>
<li>Select Add -> Existing item</li>
+
<li>Browse to the zlib source directory (CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib) and select the gzclose.c, gzlib.c, gzread.c, and gzwrite.c files (hold Ctrl while clicking to select multiple files).</li>
<li>Browse to the zlib source directory (CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib) and select the gzlib.c file</li>
+
<li>Click "Add".</li>
<li>Do the same step above for gzclose.c, gzread.c, and gzwrite.c</li>
+
<li>Right click on the zlib project in the solution explorer and select ''Properties''.</li>
<li>Right click on the zlib project and select ''Properties''.</li>
+
<li>In the panel that opens, set (or verify) the following items as follows:
<li>Open 'Configuration Properties'' > ''C/C++'' > ''Preprocessor''</li>
+
{| class="wikitable"
<li>Remove the ''Z_SOLO'' directive from  ''Preprocessor Directives'' - Do this for both the LIB Release and LIB Debug configurations.</li>
+
!Left Pane
 +
!Right pane parameter
 +
!Right pane value (drop down)
 +
|-
 +
|Configuration Properties > C/C++ > Preprocessor
 +
|Preprocessor Definitions
 +
|''Remove '''Z_SOLO''' if present, leave everything else alone''
 +
|}
 +
</li>
 +
<li>Click "Apply" and then "OK".
 +
</ol>
 +
<li>Repeat the following steps for each of these projects:  "libpng", "pngtest", "pngvalid", and "zlib".</li>
 +
<ol style="list-style-type:lower-latin">
 +
<li>Right-click on the project in the ''Solution Explorer'' and choose ''Properties''.</li>
 +
<li>In the panel that opens, set (or verify) the following items as follows:
 +
{| class="wikitable"
 +
!Left Pane
 +
!Right pane parameter
 +
!Right pane value (drop down)
 +
|-
 +
|Configuration Properties > General
 +
|Project Defaults > Whole Program Optimization
 +
|No Whole Program Optimization
 +
|-
 +
|Configuration Properties > C/C++ > Optimization
 +
|Whole Program Optimization
 +
|No
 +
|-
 +
|Configuration Properties > C/C++ > Code Generation
 +
|Runtime Library
 +
|Multi-threaded DLL (/MD)
 +
|}
 +
</li>
 +
<li>Click "Apply".</li>
 +
<li>Click on the configuration drop down at the upper left of the panel and select "Debug Library".</li>
 +
<li>Set (or verify) the following items as follows, noting that the 4th item is not the same as in the previous list.
 +
{| class="wikitable"
 +
!Left Pane
 +
!Right pane parameter
 +
!Right pane value (drop down)
 +
|-
 +
|Configuration Properties > General
 +
|Project Defaults > Whole Program Optimization
 +
|No Whole Program Optimization
 +
|-
 +
|Configuration Properties > C/C++ > General
 +
|Treat Warnings As Errors
 +
|No (/WX-)
 +
|-
 +
|Configuration Properties > C/C++ > Optimization
 +
|Whole Program Optimization
 +
|No
 +
|-
 +
|Configuration Properties > C/C++ > Code Generation
 +
|Runtime Library
 +
|Multi-threaded Debug DLL (/MDd)
 +
|}
 +
</li>
 +
<li>Click "Apply" and "OK".
 +
<li>(Remember you need to follow these steps four times, once each for libpng, pngtest, pngvalid, AND zlib!)
 +
</ol>
 +
<li>Select “Debug Library” from the ''Solution Configurations'' drop down in the IDE toolbar, then right click the top line in the Solution Explorer (Solution 'vstudio') and choose ''Build Solution''.</li>
 +
<li>Select the “Release Library” configuration, and build the solution.</li>
 +
<li>In the ''CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png'' folder, create a ''lib'' folder. Then:</li>
 +
<ul>
 +
<li>Copy ''png/projects/vstudio/Debug Library/libpng15.lib'' to ''CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png\lib'' and rename it ''libpngd.lib''</li>
 +
<li>Copy ''png/projects/vstudio/Release Library/libpng15.lib'' to ''CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png\lib'' and rename it ''libpng.lib''</li>
 +
</ul>
 +
<li>In the ''CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib'' folder, create a ''lib'' folder. Then:</li>
 +
<ul>
 +
<li>Copy ''png/projects/vstudio/Debug Library/zlib.lib'' to ''CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib\lib'' and rename it ''zlibd.lib''</li>
 +
<li>Copy ''png/projects/vstudio/Release Library/zlib.lib'' to ''CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib\lib''</li>
 +
</ul>
 
</ol>
 
</ol>
<li>Right-click on the “libpng” project in the ''Solution Explorer'' and choose ''Properties''.</li>
 
<li>Select configuration “LIB Debug” in the popup menu at the top.</li>
 
<li>Select ''Configuration Properties'' > ''C/C++'' and set ''Treat Warnings As Errors'' to ''No''</li>
 
<li>Select ''Configuration Properties'' > ''C/C++'' > ''Code Generation'' on the left.</li>
 
<li>Change the ''Runtime Library'' line to “Multi-threaded Debug DLL (/MDd)”.</li>
 
<li>Select "C/C++ -> Optimization" in the left pane, and set "Whole Program Optimization" in the right pane to "No".</li>
 
<li>Choose the “LIB Release” configuration and set ''Runtime Library'' to “Multi-threaded DLL (/MD)”.</li>
 
<li>Repeat the above 7 steps for the other two projects “pngtest” and “zlib”.</li>
 
<li>Select “LIB Debug” from the ''Solution Configurations'' popup menu in the toolbar, then ''Build'' > ''Build Solution''.</li>
 
<li>Select the “LIB Release” configuration and build the solution.</li>
 
<li>Rename ''png/projects/vstudio/Debug Library/libpn16.lib'' to ''libpngd.lib'' and copy it to ''CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png\lib''</li>
 
<li>Rename ''png/projects/vstudio/Release Library/libpn16.lib'' to ''libpng.lib'' and copy it to ''CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png\lib''</li>
 
<li>Rename ''png/projects/vstudio/Debug Library/zlib.lib'' to ''zlibd.lib'' and copy it to ''CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib\lib''</li>
 
<li>Copy ''png/projects/vstudio/Release Library/zlib.lib'' to ''CWE\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib\lib''</li>
 
</ol></ul>
 
  
 
== Required source code changes for newer version of DirectX SDK ==
 
== Required source code changes for newer version of DirectX SDK ==
Since we are using a newer version of the DirectX SDK (which supports Visual Studio 2010 Express), we will need to change the source code slightlyWe are not changing this in the source tree, since OpenUru is still using the original libraries and VS2003.
+
<p>Revisions of the client source code after November 2020 (newer than the branch marked '''VS2003_FINAL''') no longer require any changes to compile under Visual Studio 2010.  To compile with the Express version of VS2010, you still need the changes marked below.</p>
<ul>
 
<li> In file "CWE\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\PubUtilLib\plPipeline\plDXPipeline.cpp":<BR>
 
Change "#include <dxerr9.h>" to "#include <dxerr.h>"<BR>
 
Change "DXGetErrorString9" to "DXGetErrorString"<BR>
 
</li><BR>
 
<li> In file "CWE\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\PubUtilLib\plAudio\plWavFile.cpp":<BR>
 
Change "#include <dxerr9.h>" to "#include <dxerr.h>"
 
</li><BR>
 
<li> In file "CWE\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\PubUtilLib\plAudio\plEAXEffects.cpp":<BR>
 
Remove the "#include <dmusici.h>" line<BR>
 
Change "#include <dxerr9.h>" to "#include <dxerr.h>"
 
</li><BR>
 
</ul>
 
  
 
== Required source changes for Visual Studio 2010 Express ==
 
== Required source changes for Visual Studio 2010 Express ==
Line 234: Line 363:
 
<b>Note: If you are compiling with VS2010 Professional or greater, you do *not* need to make these edits.  Only the Express edition excludes MFC.</b><BR>
 
<b>Note: If you are compiling with VS2010 Professional or greater, you do *not* need to make these edits.  Only the Express edition excludes MFC.</b><BR>
 
<BR>
 
<BR>
<li>Edit '''plClient.rc''' file located in "CWE\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\Apps\plClient\res\"<BR>
+
<li>Edit '''plClient.rc''' file located in "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\Apps\plClient\res\"<BR>
 
'''Before'''<BR>
 
'''Before'''<BR>
 
<pre>
 
<pre>
Line 264: Line 393:
 
#define IDC_STATIC (-1)
 
#define IDC_STATIC (-1)
 
</pre></li>
 
</pre></li>
<li>edit '''plUruLauncher.rc''' file located in "CWE\MOULOpenSourceClientPlugin\Plasma20\Apps\plUruLauncher.rc"<BR>
+
<li>edit '''plUruLauncher.rc''' file located in "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\Apps\plUruLauncher\"<BR>
 
This is the same change we just made in the previous file.<BR>
 
This is the same change we just made in the previous file.<BR>
 
'''Before'''<BR>
 
'''Before'''<BR>
Line 300: Line 429:
 
Now that the prep is done, you can actually build the client.
 
Now that the prep is done, you can actually build the client.
 
<ol>
 
<ol>
<li> Open the "CWE\MOULOpenSourceClientPlugin\Plasma20\MSVC10Projects\Plasma\Apps\AllClient\AllClient.sln" in the VS2010 IDE.</li>
+
<li> Open the "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\MSVC10Projects\Plasma\Apps\AllClient\AllClient.sln" in the VS2010 IDE.</li>
 
<li> Select the type of build you want from the dropdown on the IDE toolbar.
 
<li> Select the type of build you want from the dropdown on the IDE toolbar.
 
* Release
 
* Release
Line 309: Line 438:
 
<li> Right click on the "AllClient" project and select "Build".</li>
 
<li> Right click on the "AllClient" project and select "Build".</li>
 
<BR>
 
<BR>
Completed builds are copied into the "CWE\MOULOpenSourceClientPlugin\Plasma20\test" directory.
+
Completed builds are copied into the "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\test" directory.
 
<BR>
 
<BR>
 
'''Note:''' You '''*must*''' make sure your client is using the same versions of the PhysX DLLs that you built with.  They are not compatible from version to version.
 
'''Note:''' You '''*must*''' make sure your client is using the same versions of the PhysX DLLs that you built with.  They are not compatible from version to version.
Line 315: Line 444:
  
 
If, after building the client, you require the server prep tools (plFileSecure, plFileEncrypt, plPythonPak), right click on those specific projects and click "Build".<BR>  
 
If, after building the client, you require the server prep tools (plFileSecure, plFileEncrypt, plPythonPak), right click on those specific projects and click "Build".<BR>  
The compiled files will be copied into the "CWE\MOULOpenSourceClientPlugin\Plasma20\tools" directory.
+
The compiled files will be copied into the "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\tools" directory.
  
 
[[Category:Cyan_Worlds]]
 
[[Category:Cyan_Worlds]]

Latest revision as of 09:46, 9 November 2020


Introduction

This document provides steps to build the CWE client with MSVC 2010 SP1 Express.

Before you begin

  • If you have a version of Visual Studio later than 2010 installed, you may need to uninstall it.
  • If you have Microsoft Visual C++ 2010 Redistributable installed (x86 and/or x64), you will need to uninstall it before installing DirectX SDK. While installing Visual Studio, the Redistributable package(s) will be reinstalled for you automatically.

Items needed to compile

See Build preparation steps for installation instructions!

Newer versions of these libraries may work, but no guarantees are offered; these are what have been tested. See the next section for restrictions on using newer versions.

Notes

  • This guide assumes you are going to use the 7.0A SDK installed with Visual Studio 2010, and are using a 64 bit Windows install.
  • You can upgrade to a newer version of Speex if you like, but you will need to fix the Speex VS2010 projects first (by removing the architectures we do not have from the Speex project files).
  • Libogg 1.3.2 was used because xiph removed the VS2010 projects from 1.3.3 and above.
  • You must use a 2.6.x version of PhysX for CWE, because the cooked mesh format was changed in PhysX 2.7.x and later.
  • All libraries are compiled with "Whole Program Optimization" turned off.
  • Release version libraries are compiled as "Multi-threaded DLL (/MD)"
  • Debug version libraries are compiled as "Multi-threaded Debug DLL (/MDd)"
  • Crypto keys are located in "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\NucleusLib\pnNetBase". Edit the *.hpp files with a text editor to replace Cyan's keys with your own server's keys. Always clean your solution and rebuild when you change crypto keys, to make sure they are updated.
  • Server hostnames, IP addresses, and ports are located in the following files:
The status URL:
"CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/winmain.cpp"
"CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plUruLauncher/Main.cpp"
The auth/gatekeeper address
"CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbSrvs.cpp"
The default client port
"CWE-ou\MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnNetBase/pnNbConstant.h"

Build preparation steps

git (Optional)

If you plan to make changes to the source code and contribute to the community, install git (accepting the default options).

CWE-ou

Obtain CWE-OU source by one of these methods:

  • Use git clone with the repository link found on the webpage referenced above
  • Click "tree" in the top menu of the webpage reference above, then click "zip" to download a ZIP archive

DirectX

Install the DirectX 9.0c SDK and copy it to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\DX9.0c".

Install the DirectX SDK before you install VS2010 Express, or the DirectX SDK install will throw error S1023, due to a newer version of the C++ 2010 redistributables being installed.

Directory structure in the CWE tree will look like this:

  StaticSDKs
    Win32
      DX9.0c
        include
        Lib

Visual Studio 2010 Express

  • Install Visual Studio 2010 Express
  • Install Service Pack 1 (SP1) for Visual Studio 2010, plus security updates (run Windows Update a few times)
  • Copy the include and lib directories from the SDK installed with VS2010 SP1 Express to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PlatformSDK". The directory where the SDK resides will most likely be "Program Files (x86)\Microsoft SDKs\Windows\v7.0A". As the SDK is in our path, this step is probably not necessary but we will do it for consistency.

Directory structure in the CWE tree will look like this:

StaticSDKs
  Win32
    PlatformSDK
      include
      lib

OpenAL SDK

Install the OpenAL SDK and copy the include and lib directories to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK"

Directory structure in the CWE tree will look like this:

  StaticSDKs
    win32
      OpenAL 1.1 with EFX SDK
        include
        libs

PhysX SDK

Install PhysX SDK, and copy PhysX subdirectories as follows:

  • Copy from "Program Files (x86)\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\SDKs" to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PhysX"
  • Copy from and "Program Files (x86)\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4\Bin" to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\PhysX"

Directory structure in the CWE tree will look like this:

  StaticSDKs
    Win32
      PhysX
        Bin
        Cooking
        Docs
        Foundation
        Framework
        lib
        ...

libogg and libvorbis

Build Ogg and Vorbis

  1. Create a directory and extract Ogg and Vorbis archives to it.
    oggvorbis
      libogg-1.3.2
      libvorbis-1.3.6
  2. Change directory to "libvorbis-1.3.6\win32\vs2010" and edit the libogg.props file. Make sure the "LIBOGG_VERSION" value matches your version of Ogg (1.3.2 in this document).
  3. Open "libogg-1.3.2\win32\VS2010\libogg_static.sln" in the Visual Studio IDE and perform the following steps:
    1. On the IDE toolbar, click on configuration drop down at the upper left (it defaults to "Debug") and change it to "Release"
    2. Right click on the project (e.g. "libogg_static") in the Solution Explorer at upper left, and select Properties.
    3. In the panel that opens, set (or verify) the following items as follows:
      Left Pane Right pane parameter Right pane value (drop down)
      Configuration Properties -> General Whole Program Optimization No Whole Program Optimization
      C/C++ -> Optimization Whole Program Optimization No
      C/C++ Code Generation Runtime Library Multi-threaded DLL (/MD)
    4. Click on "Apply"
    5. Click on configuration drop down at the upper left of the panel and select "Debug". Set (or verify) the following items as follows, noting that the 3rd item is not the same as in the previous list.
    6. Left Pane Right pane parameter Right pane value (drop down)
      Configuration Properties -> General Whole Program Optimization No Whole Program Optimization
      C/C++ -> Optimization Whole Program Optimization No
      C/C++ Code Generation Runtime Library Multi-threaded Debug DLL (/MDd)
    7. Click "Apply" and then "OK".
    8. On the IDE toolbar, verify the configuration drop down is still set to "Release". Then right click on the project in the solution explorer and select "Build".
    9. On the IDE toolbar, select "Debug" from the drop down. Then right click on the project in the solution explorer and select "Build".
  4. Open "libvorbis-1.3.6\win32\VS2010\vorbis_static.sln" in the Visual Studio IDE, and repeat the preceding steps for projects libvorbis_static and libvorbisfile.

Copy Ogg and Vorbis files to CWE

  1. Copy the ogg and vorbis include directories into "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\include". It is okay to let it overwrite.
  2. Copy the "libogg-1.3.2\win32\VS2010\Win32\Release" and "Debug" directories into "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib"
  3. Copy the "libvorbis-1.3.6\win32\VS2010\Win32\Release" and "Debug" directories to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib"

Directory structure in the CWE tree will look like this:

  StaticSDKs
    win32
      xiph
        include
          ogg
          vorbis
        lib
          Debug
          Release

Speex

Rebuild the Speex 1.0.1 included in the CWE tree.

  1. Open CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\libspeex.sln in the Visual Studio 2010 IDE, and convert.
  2. Click on configuration drop-down on the upper left and select "Release"
  3. Right click on project in the solution explorer and select properties.
  4. In the panel that opens, set (or verify) the following items as follows:
    Left Pane Right pane parameter Right pane value (drop down)
    Configuration Properties -> General Whole Program Optimization No Whole Program Optimization
    C/C++ -> Optimization Whole Program Optimization No
    C/C++ Code Generation Runtime Library Multi-threaded DLL (/MD)
  5. Click on "Apply".
  6. Click on configuration drop-down on the upper left of the properties page and select "Debug". Set (or verify) the following items as follows, noting that the 3rd item is not the same as in the previous list.
  7. Left Pane Right pane parameter Right pane value (drop down)
    Configuration Properties -> General Whole Program Optimization No Whole Program Optimization
    C/C++ -> Optimization Whole Program Optimization No
    C/C++ Code Generation Runtime Library Multi-threaded Debug DLL (/MDd)
  8. Click "Apply" and then "OK".
  9. On the IDE toolbar, select "Release" from the drop down. then right click on the project in the solution explorer and select "Build".
  10. On the IDE toolbar, select "Debug" from the drop down. then right click on the project in the solution explorer and select "Build".
  11. Copy the headers (.h files) from CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\libspeex to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\include\speex
  12. Copy CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\Release\libspeex.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib\Release
  13. Copy CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\speex-1.0.1\win32\libspeex\Debug\libspeex.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\xiph\lib\Debug

OpenSSL

Compile and install OpenSSL (see Build OpenSSL with MS Visual C++), or obtain precompiled binaries (32-bit, not 64-bit).

If compiling it yourself, you can choose either static or dynamic linking. Note: If you link it dynamically, it will cause the Uru client to require the OpenSSL DLLs to be present in the client directory or in the system path.

Copy the installed OpenSSL files to "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\Win32\OpenSSL".

Directory structure in the CWE tree will look like this:

  StaticSDKs
     Win32
       OpenSSL
         bin
         include
           openssl
         lib

JPEG

Build in-tree JPEG library

  1. Open "Visual Studio Command Prompt (2010)" and change to the "CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\jpeg-8c-rgba directory."
  2. Copy makefile.vc to makefile.nmake
  3. Copy jconfig.vc to jconfig.h
  4. Run nmake nodebug=1 -f makefile.nmake. This will build the library in non-debug mode. If you use a debug library, the linker will complain when we link the client executable.

zlib and libpng

Build zlib and libpng

  1. Extract the files in the zlib archive to MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/zlib.
  2. Extract the files in the libpng archive to MOULOpenSourceClientPlugin/StaticSDKs/XPlatform/png.
  3. Edit the png/projects/vstudio/zlib.props file. Towards the bottom is a path for ZLibSrcDir. Change the value to "..\..\..\..\zlib" (no -1.2.5 or such on the end) and save the file.
  4. Open png/projects/vstudio/vstudio.sln in the Visual Studio 2010 IDE.
  5. On the IDE toolbar, click on the configuration drop down at the upper left (it defaults to "Debug") and change it to "Release Library".
  6. The VS2010 zlib project file distributed in the png archive is set to build for embedded environments. We need to reconfigure it.
    1. Right click on the zlib project tree in the solution explorer and select "Add > Existing item"
    2. Browse to the zlib source directory (CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib) and select the gzclose.c, gzlib.c, gzread.c, and gzwrite.c files (hold Ctrl while clicking to select multiple files).
    3. Click "Add".
    4. Right click on the zlib project in the solution explorer and select Properties.
    5. In the panel that opens, set (or verify) the following items as follows:
      Left Pane Right pane parameter Right pane value (drop down)
      Configuration Properties > C/C++ > Preprocessor Preprocessor Definitions Remove Z_SOLO if present, leave everything else alone
    6. Click "Apply" and then "OK".
  7. Repeat the following steps for each of these projects: "libpng", "pngtest", "pngvalid", and "zlib".
    1. Right-click on the project in the Solution Explorer and choose Properties.
    2. In the panel that opens, set (or verify) the following items as follows:
      Left Pane Right pane parameter Right pane value (drop down)
      Configuration Properties > General Project Defaults > Whole Program Optimization No Whole Program Optimization
      Configuration Properties > C/C++ > Optimization Whole Program Optimization No
      Configuration Properties > C/C++ > Code Generation Runtime Library Multi-threaded DLL (/MD)
    3. Click "Apply".
    4. Click on the configuration drop down at the upper left of the panel and select "Debug Library".
    5. Set (or verify) the following items as follows, noting that the 4th item is not the same as in the previous list.
      Left Pane Right pane parameter Right pane value (drop down)
      Configuration Properties > General Project Defaults > Whole Program Optimization No Whole Program Optimization
      Configuration Properties > C/C++ > General Treat Warnings As Errors No (/WX-)
      Configuration Properties > C/C++ > Optimization Whole Program Optimization No
      Configuration Properties > C/C++ > Code Generation Runtime Library Multi-threaded Debug DLL (/MDd)
    6. Click "Apply" and "OK".
    7. (Remember you need to follow these steps four times, once each for libpng, pngtest, pngvalid, AND zlib!)
  8. Select “Debug Library” from the Solution Configurations drop down in the IDE toolbar, then right click the top line in the Solution Explorer (Solution 'vstudio') and choose Build Solution.
  9. Select the “Release Library” configuration, and build the solution.
  10. In the CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png folder, create a lib folder. Then:
    • Copy png/projects/vstudio/Debug Library/libpng15.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png\lib and rename it libpngd.lib
    • Copy png/projects/vstudio/Release Library/libpng15.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\png\lib and rename it libpng.lib
  11. In the CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib folder, create a lib folder. Then:
    • Copy png/projects/vstudio/Debug Library/zlib.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib\lib and rename it zlibd.lib
    • Copy png/projects/vstudio/Release Library/zlib.lib to CWE-ou\MOULOpenSourceClientPlugin\StaticSDKs\XPlatform\zlib\lib

Required source code changes for newer version of DirectX SDK

Revisions of the client source code after November 2020 (newer than the branch marked VS2003_FINAL) no longer require any changes to compile under Visual Studio 2010. To compile with the Express version of VS2010, you still need the changes marked below.

Required source changes for Visual Studio 2010 Express

  • We do not have MFC with VS2010 SP1 Express, so we need to replace the first reference to afxres.h. The client portion of CWE does not use MFC (I believe the MAX plugin does), so we can make this replacement.

  • Note: If you are compiling with VS2010 Professional or greater, you do *not* need to make these edits. Only the Express edition excludes MFC.

  • Edit plClient.rc file located in "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\Sources\Plasma\Apps\plClient\res\"
    Before
    // Microsoft Visual C++ generated resource script.
    //
    #include "resource.h"
    
    #define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 2 resource.
    //
    #include "afxres.h"
    

    After

    // Microsoft Visual C++ generated resource script.
    //
    #include "resource.h"
    
    #define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 2 resource.
    //
    //#include "afxres.h"
    
    #include <windows.h>
    #define IDC_STATIC (-1)
    
  • edit plUruLauncher.rc file located in "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\Apps\plUruLauncher\"
    This is the same change we just made in the previous file.
    Before
    // Microsoft Visual C++ generated resource script.
    //
    #include "resource.h"
    
    #define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 2 resource.
    //
    #include "afxres.h"
    

    After

    // Microsoft Visual C++ generated resource script.
    //
    #include "resource.h"
    
    #define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 2 resource.
    //
    //#include "afxres.h"
    
    #include <windows.h>
    #define IDC_STATIC (-1)
    

Build the client

Now that the prep is done, you can actually build the client.

  1. Open the "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\MSVC10Projects\Plasma\Apps\AllClient\AllClient.sln" in the VS2010 IDE.
  2. Select the type of build you want from the dropdown on the IDE toolbar.
    • Release
    • Release_Internal
    • Debug
    • Debug_Internal
  3. Right click on the "AllClient" project and select "Build".

  4. Completed builds are copied into the "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\test" directory.
    Note: You *must* make sure your client is using the same versions of the PhysX DLLs that you built with. They are not compatible from version to version.

If, after building the client, you require the server prep tools (plFileSecure, plFileEncrypt, plPythonPak), right click on those specific projects and click "Build".
The compiled files will be copied into the "CWE-ou\MOULOpenSourceClientPlugin\Plasma20\tools" directory.