newspeoplefor developersdocumentationdownloads

Compiling Nebula2 on Windows

Additional Requirements

  • Windows 2000 or Windows XP (other Win32 platforms may work but have not been tested)
    • Microsoft no longer supports using Windows 2000 with the most recent DirectX SDKs.
  • Microsoft DirectX 9 SDK. Nebula2 does not work with versions earlier than the 2003 "Summer Update" version. We do not support the 2004 Summer SDK due to bugs in that SDK, but the October 2004 and later versions are fine.

  • Visual 7.0 - 8.0 (.NET), or Visual C++ Toolkit 2003.
  • Visual C++ 6 is no longer supported.

If you are using Visual C++ Toolkit 2003, then you will need an updated Core SDK from Microsoft. Without this, Nebula will fail to compile due a missing shfolder.h, or because of the lack of headers/libs (in the toolkit).

Preparation

  • Add nebula2/bin/win32 to your path

Visual C++ 7.0 and later

  • Download the Nebula and Mangalore dependency packages and extract them into your source checkout. Make sure you download the right ones for you compiler (vc8 means Visual C++ 2005, vc71 means Visual C++ 2003).
  • Under "Tools->Options->Projects->VC++ Directories" make sure that the DX9 libs and include directories are before VStudio's lib and include directory paths (Note: Do not do this if you are using VC 8.0, the headers included with VC 8.0 are newer than those in the DX SDK).

Visual C++ 2003 Toolkit

These instructions also apply if you are building using make and a regular copy of Visual C++.

Download the Nebula and Mangalore dependency packages and extract them into your source checkout. Make sure you download the right ones for you compiler (vc8 means Visual C++ 2005, vc71 means Visual C++ 2003).

Note:
Instead of using GNU Make or Cygwin you might want to experiment with vcbuild, we haven't tried it though so it may not work.
In order to compile with the toolkit, you will need these additional requirements:

  • GNU Make or a Cygwin environment

If using a regular command prompt, make sure that make.exe is located on your path.

Create The Build Files

Anytime files are added or removed from Nebula 2 this step must be repeated.

Visual C++ 7.0 and later

Navigate to nebula2/ and double click on update.py, if you correctly installed Python and wxPython you should see the Nebula 2 Build System application displayed. You can use this application to create the project and solution files for Visual Studio, in the directory nebula2/build/vstudio##. Read the manual that's available through Help->Manual on the Main Menu to figure out what you need to do before proceeding to the next step.

Visual C++ 2003 Toolkit or Other

Note:
If you're experimenting with vcbuild - generate build files for Visual C++ 7.1 as described above instead of using update.tcl as described below.
Navigate to nebula2/ and double click update.py. Makefiles for the Visual C++ 2003 Toolkit are generated in the directory nebula2/build/makefile.

Compiling

Visual C++ 7.0 and later

Open the Nebula2.sln (or whatever solution you want to build) in the directory that corresponds to your version of Visual Studio. Then select Build->Build Solution from the Main Menu. The binaries will be located in nebula2/bin/win32, or nebula2/bin/win32d for debug versions.

If you'd like to do a command-line based build using Visual Studio, rather than deal with Makefiles and the like, try using devenv.com /build:

Note: be sure to use devenv.com rather than devenv.exe as it is lighter weight and still gets the job done.

Visual C++ 2003 Toolkit or Other

To create the correct build environment:
  • Launch a Visual C++ 2003 Toolkit Prompt.
  • Add path/to/your/directx/sdk/Lib to the "LIB" environment variable, and path/to/your/directx/sdk/Bin to the "INCLUDE" variable.
  • Navigate to the directory in which the Microsoft Platform SDK is installed, and execute the "SetEnv" batch file.
  • Navigate to your nebula2 "build/makefile" directory.

Note:
If you wish to compile in cygwin, you will need to create a custom script to set the PATH, INCLUDE, and LIB environment variables for the compiler to work.
Run "make" to build nebula2. e.g:

    make [workspace]

This will compile the workspace "[workspace]", or alternatively if a workspace is not specified, everything. Executable files will be located in nebula2/bin/win32, and will have a ".exe" extension.

If you wish to compile a debug build, set the "N_DEBUG" parameter to "true", e.g.:

  make N_DEBUG=true [workspace]

Executable files will then be located in nebula2/bin/win32d.

Troubleshooting

  • The IDE doesn't recognize .cc files as c++ source in VS7.1:

Open Studio, go to Tools...Options...Projects...VC++ Build...C/C++ File Extensions and add .cc.

  • The nmake fails

You may need to set up the Visual Studio environment variables. You can do this by running the VCVARS32.BAT batch file, which usually exists in a directory like C:\Program Files\Microsoft Visual Studio\VC98\Bin\. If you get errors while running that batch file about being out of environment space, please see this.

  • error C2660: 'D3DXCreateFont' : function does not take 12 parameters

Install one of the supported versions of the DirectX 9 SDK, as described above.

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.