Windows compiling requirements

From OHRRPGCE-Wiki
Jump to: navigation, search

A list of things that you need to install and configure (don't forget the last item!) in order to compile the OHRRPGCE source code:

FreeBasic[edit]

You need the Freebasic compiler from http://www.freebasic.net/.

There are quite a few alternative downloads for FB provided, in two main flavours: those compatible with MinGW, and those compatible with MinGW-w64.

Therefore please read Getting FreeBasic and the next section before deciding which version of FB to install.

Don't download "gcc-5.2.0-for-FB-win32-gengcc.zip for -gen gcc" from the FB Downloads page, as this includes only gcc.exe and a couple libraries. You need a more complete build of GCC include g++ (see next section).

MinGW C and C++ compilers[edit]

You need a copy of GCC. There are several distributions of GCC for Windows, including MinGW, mingw-w64 and Win-builds. We haven't tested mingw-w64 or win-builds! It should also be possible to use a different C/C++ compiler which understands many of the same commandline options as GCC.

See also GCC toolchain choice on the FB wiki.

Beware! You need to install a version and distribution of GCC/MinGW which is compatible with the version of MinGW which the FB developers used to compile the build of FreeBasic you install. Otherwise you will get errors like:

C:\Program Files\FreeBASIC1.04\lib\win32/libfbmt.a(time_now.o):time_now.c:(.text+0x11): undefined reference to `_time32'
C:\Program Files\FreeBASIC1.04\lib\win32/libfbmt.a(time_now.o):time_now.c:(.text+0x19): undefined reference to `_localtime32'

This table shows some known (in)compatibilities:

GCC distribution version FB version Works?
MinGW mingw32-base 2013072200, GCC 4.8.1-4 1.04.0 ('Alternative' FreeBASIC-1.04.0-2-win32-mingworg.zip) Compatible
MinGW mingw32-base 2013072200, GCC 4.8.1-4 1.04.0 (FreeBASIC-1.04.0-win32.exe) Not compatible
MinGW mingw32-base 2013072200, GCC 4.8.1-4 0.23.0 Compatible


You don't need to install SDL and SDL_mixer development libraries; the necessary header and library files are included with FreeBASIC and the OHR source code.

MinGW[edit]

MinGW has not been updated in a couple years, and might be dead. The easiest way to install it is with the latest mingw-get-inst. Include the optional g++ package in your installation.

Euphoria (optional)[edit]

To compile hspeak you need Euphoria 4.0+ from http://openeuphoria.org/

Python[edit]

Install Python 2.7 from http://python.org/. We don't support Python 3.x.

Scons[edit]

You need the scons build system from scons.org. Scons is a python package, so you first need to install python.

For gfx_directx.dll (optional)[edit]

The following are needed only if you want to compile gfx_directx.dll. (A pre-compiled copy is included with the source code.)

Visual Studio[edit]

GCC can't be used to compile gfx_directx.dll. Install Visual C++. You don't need support for any other languages such as C# or any of the numerous extras that the installer includes. 2008, 2010, 2010 Express (and 2013 Express?) are known to work; all Express editions should work. Versions earlier than 2008 will probably work?

If you are using Visual C++ 2008 or earlier, you are probably missing stdint.h. Download a suitable header, eg. this one, and place it in the gfx_directx directory.

If Visual Studio isn't installed correctly then attempting to compile will use GCC, which will cause strange messages about unsupported commandline options.

Make sure that you are compiling using the "Visual Studio 20XX Command Prompt" and not the regular "cmd" command prompt, or you will see an error message about missing cl.exe

Windows SDK[edit]

You need the Windows SDK. Recent versions of Visual Studio include the Windows SDK (Visual Studio 2008 and later, and Visual Studio 2010 Express and later?) Different versions of Visual Studio support different versions of the SDK, so don't just download the latest SDK (see Q: What compiler toolset does a given Windows SDK support?.

The Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 (v7.0) supports Visual Studio 2005 and later, on Win XP or later.

DirectX SDK[edit]

You can find the SDK at microsoft.com. As far as I know, any version of the SDK for DirectX 9 or later should work, because gfx_directx.dll does not use anything in the DirectX 9 extension library (which requires a special .dll).

After installing the SDK, the DXSDK_DIR environmental variable needs to be correctly set. It should be set automatically.

Updating your PATH[edit]

Some of the above-mentioned installers are smart enough to add themselves to your PATH on some versions of Windows. Others like scons may not be in your PATH by default. See this article for more information on how to make sure your PATH is set up correctly: Setting up your PATH on Windows