Page 1 of 1
How to compile UOX3 under Windows
Posted: Tue Jun 07, 2005 7:02 pm
by Xuri
How to compile UOX3 under Windows
Step 1: Clone the UOX3 Git Repository
- Download and install GitHub Desktop from (or use your preferred git tool)
- Run GitHub Desktop, and then press File->Clone Repository (or CTRL+SHIFT+O)
- Click on URL tab, then enter https://github.com/UOX3DevTeam/UOX3.git, as well as a local path for where to store the repository
- Hit the Clone button! This will clone the UOX3 repository to your drive in the specified local path.
- Move to the next post for Step 2 - Compiling UOX3!
Bonus: If you'd rather grab another branch of the git repository, like the
develop branch where most updates get pushed first before being merged into the master branch, you can click the Current branch dropdown menu in GitHub Desktop and select the branch you wish to check out.
Posted: Tue Jun 07, 2005 7:30 pm
by Xuri
Step 2: Compile UOX3
Option A) Visual Studio 2017/2019 (Free Community edition) (v15.9.22+)
This option will let you use Visual Studio solution/project files to compile both UOX3 and SpiderMonkey with Visual Studio's default VC++ compiler. Note that you can download the Free Community Edition of Visual Studio if you don't have it already. This approach also embeds SpiderMonkey directly inside UOX3 for a slightly larger (~1-2MB) executable, instead of requiring a separate DLL file, and comes with options for compiling either
32-bit or 64-bit (default) versions of UOX3.
SpiderMonkey
- Navigate to the UOX3\spidermonkey folder and open SpiderMonkey.sln in Visual Studio.
- Make sure you have js32 selected in the Solution Explorer, then select Release and either x64 (64-bit) or Win32 (32-bit) in the Solution Configuration/Platform dropdown menus
- Click Build > Build js32 from the menu.
- Visual Studio will compile SpiderMonkey and create spidermonkey\Release\x64 (64-bit) or spidermonkey\Release\x86 (32-bit) folders with the compiled js32.lib library file contained within. No further actions are necessary here, so you can close the SpiderMonkey VS Solution.
UOX3
- Open UOX3_Official.sln from the UOX3\source folder.
Make sure you have UOX3_Official selected in the Solution Explorer, then select either Release or Debug, and either x64 (64-bit) or Win32 (32-bit) in the Solution Configuration/Platform dropdown menus, or via Build -> Configuration Manager.
Select Build -> Build UOX3_Official to start compiling UOX3. When done, you'll find UOX3.exe in either UOX3\source\Release\x64 (or \x86) or UOX3\source\Debug\x64 (or \x86), depending on your choices in the previous step.
Option B) Visual Studio 2017/2019 and CMake (Free Community edition) (v15.9.22+)
This option requires installing the Visual Studio toolset named
Linux development with C++ and the component called
Visual C++ tools for CMake and Linux. Use the Visual Studio Installer to modify your install of Visual Studio if you don't already have these installed! This approach compiles SpiderMonkey to a separate DLL (
js32.dll) file that needs to live inside the same folder as the main UOX3 executable, and currently only supports compiling a
32-bit version of UOX3.
- Start Visual Studio and use File > Open > CMake and select CMakeLists.txt in the root project folder (Example: D:\UOX3). Don't open the similarly named file in the source folder directly.
- After Visual Studio is done loading the project and has generated some necessary files, select CMake > Change CMake Settings > UOX3 from the toolbar menu, and select either x86-Debug or x86-Release depending on what kind of build you want to make - or do this using the Solution Configuration select menu.
- When Visual Studio is done switching to the new configuration, select CMake > Build All from the toolbar menu to start compiling UOX3.
- When done, you'll find UOX3.exe and js32.dll in a subfolder named out of the root project folder, more specifically /UOX3/out/build/x86-Debug or x86-Release, based on the selected configuration.
- Note that the js32.dll file must be copied to the same folder as UOX3.exe!
Step 3: Copy Compiled Files
Once this process is done, you can copy your new
UOX3.exe (and if using CMake,
js32.dll) file from the appropriate output folders (depending on which method and configuration you used) to the root folder of your actual UOX3 project. You'll also need to copy the files and folders contained within the
data subfolder of the UOX3 repository, if you don't already have these.
It is recommended to run your UOX3 shard from a separate, dedicated folder instead of the data folder in your local UOX3 git repository, to avoid potential git conflicts and accidental overwrites when pulling updates to UOX3 from GitHub in the future.
Once you have all the files in place, you can follow the regular steps listed under
Installation and Setup > Configuring Your UOX3 Shard to finish your UOX3 setup!
Note that if you want to execute UOX3 from within Visual Studio 2017, you'll need to provide a copy of
js32.dll (from
UOX3\Spidermonkey\debug or \release) in
UOX3\source\debug or
\release folders, as well as specify the working directory under
Project -> Properties -> Configuration Properties -> Debugging -> Working Directory for either Debug or Release configuration (selectable from dropdown at top of window)
Posted: Thu Aug 25, 2005 4:28 am
by giwo
Just a heads up, Xu, feel free to delete this post once you read it.
js.mak does not compile properly, you will need myjs.mak (kindly provided by Maarc) which I have put up on:
http://www.sf.net/projects/openuo
Also, under MSVC .Net 2003
Go to
Tools->Options Select "Projects" and "VC++ Directories"
At the top-left of the window that pops up, under "Show directories for:", first select "Include Files", click the "New" button and put in your
mozilla/js/src dir, then select "Library Files", click the "New" button, and put in your
mozilla/js/src/debug dir, lastly select "Source Files", click the "New" button, and put in your
mozilla/js/src dir and click "Ok".
Btw, I just followed this guide step-by-step setting up my laptop. GREAT JOB, it worked perfectly.

Posted: Sat Feb 25, 2006 1:08 am
by Grimson
Xuri wrote:
2. Construct a batch file (simply a text-file with a .bat file extension) called
mymake.bat in the
mozilla/js/src directory, with the following content:
Code: Select all
nmake /f js.mak CFG="jsshell - Win32 Release" clean all
nmake /f js.mak CFG="jsshell - Win32 Debug" clean all
3. Execute
mymake.bat from within the directory mozilla/js/src. The necessary js32.dll and js32.lib files will now be created and placed in the Debug and Release subdirectories of mozilla/js/src.
Note: This doesn't work anymore using the latest SpiderMonkey CVS versions. As they dropped support for VC6, so the js.mak is outdated and won't compile the sources right.
Posted: Sat Feb 25, 2006 1:39 am
by giwo
Notably VC 2003 .net will not properly (at least I after an hour of toying was not able to get it to) compile the current mozilla JS source either.
I'm assuming since they don't claim to not support any versions of MSVC, there will eventually be a fix for this up.
Posted: Thu Dec 11, 2008 3:51 pm
by Jediman
Can someone update this for us on Visual Studio 2008?
--
Edit: Nevermind, works the same as VS2005...nice!
Re: How to compile UOX3 under Windows
Posted: Wed Nov 23, 2016 6:38 am
by Xuri
I managed to compile UOX3 for Windows just now using the free Visual Studio Community 2015.
- First, I enabled nmake by running Vcvarsall.bat from a command prompt in the "C:\Program Files (x86)Microsoft Visual Studio 14.0\VC" folder
- Then, I ran mymake.bat from command prompt while in spidermonkey source folder. Lots of warnings, but it seemed to compile, and the resulting js32.dll in release folder seems to work with a compiled release build of UOX3 too.
- Next, I first opened the existing UOX3_VC2005 project file in VS Community 2015 and let the (one-way, backup first) conversion-process run its course.
- Next up, I changed the following in platform.h from...
...to...
Code: Select all
# if _MSC_VER < 1900
# define snprintf _snprintf
# endif
# if _MSC_VER >= 1900
# define STDC99
# endif
- After this, I opened the Property Manager tab (found next to Solution Explorer and Class View at bottom of screen, on left hand side), selected UOX3_Official -> C/C++ -> Preprocessor and added a new Preprocessor Definition for both Release and Debug profile: _CRT_NO_VA_START_VALIDATION
- As well as a debug-specific Preprocessor Definition that I needed to avoid some ITERATOR_DEBUG_LEVEL mismatch errors: _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH
- And then, I followed the instructions from second post in this thread regarding folders to include in Include (spidermonkey source folder), Library (spidermonkey/release or spidermonkey/debug depending on profile) and Source (spidermonkey source folder) directories
- Lastly, I commented out the following two bits of code from cConsole.cpp, because they were generating an error which I do not know how to fix XD; DISCLAIMER: I have no idea what problems commenting out this code can/will cause.
Code: Select all
/*CConsole& CConsole::operator<<( const std::ostream& outPut )
{
StartOfLineCheck();
std::cout << outPut;
return (*this);
}*/
...and...
Code: Select all
/*CConsole& CConsole::operator<<( std::ostream& outPut )
{
StartOfLineCheck();
std::cout << outPut;
return (*this);
}*/
Aside from various warnings about deprecated stuff (mostly related to winsock), both release and debug versions seem to compile and run okay

Re: How to compile UOX3 under Windows
Posted: Sun Nov 27, 2016 7:08 am
by Humility
Thank you for this, I get lost in my own library but I finally managed to find the properties you were speaking of and add the preprocessor stuff. I am now able to compile it in 2013 ultimate also.
Re: How to compile UOX3 under Windows
Posted: Wed Nov 30, 2016 1:35 pm
by Xuri
Great!

Re: How to compile UOX3 under Windows
Posted: Mon Feb 26, 2018 11:49 am
by Xuri
I'm back! This time compiling for Visual Studio Community 2017.
First, I opened the Visual Studio 2017 Installer, hit Modify, and went on to install
SDKs, Libraries and Frameworks -> Windows 8.1 SDK and
Compilers, build tools and runtimes -> Windows Universal CRT SDK.
Second, I took the uox3 source & spidermonkey folders from my 2015 build, and included the spidermonkey root (source), release and debug folders in the VC++ Directories, just like before.
Third, I added all the preprocessor definitions I mentioned in my Visual Studio 2015 post (scroll up)
Fourth, I commented out some unfinished bandage macro code that I might have added since last time I compiled, but which now caused errors while compiling
Fifth, compiled!

Re: How to compile UOX3 under Windows
Posted: Fri Mar 02, 2018 6:01 am
by giwo
Woohoo!
Re: How to compile UOX3 under Windows
Posted: Sun Sep 09, 2018 12:44 pm
by Xuri
Re: How to compile UOX3 under Windows
Posted: Thu Sep 10, 2020 11:39 pm
by Xuri
Updated original post(s) with up-to-date instructions for compiling (64-bit version of) UOX3 v0.99.3 using Visual Studio (js32.dll-free) and/or CMake (depends on js32.dll still). These instructions can also be found in the
UOX3 Documentation, and on
GitHub.