Imprudence:Compiling/1.4/Windows

Windows compiling instructions for 1.4.x. Please correct any errors or missing information. Visual Studio 2005 is the default compiler for Imprudence. Feel free to post about issues using it, the Express Editions, 2008, or 2010 in the development forums.

Also, remember: Visual Studio is NOT the same thing as Visual C++ Express (also called VCExpress)!

Necessary software

 * Visual Studio 2005 (VS2008 will work for everything but plugins; 2010 will currently fail--patches welcome to fix that up). You can download Visual C++ Express 2005 and SP1 (SP1 for Vista) or Visual C++ Express 2008 for free. If you have a student email, you can also download Visual Studio 2005, 2008, or 2010 Professional for free from Microsoft's dreamspark website.
 * Visual Studio 2005 redistributable (only if you're not using Visual Studio 2005).


 * CMake 2.6.2 (or greater). Add CMake to your system PATH.
 * ActivePython 2.5 or 2.6.
 * Cygwin. Make sure patchutils, flex, and bison are included under "devel". DON'T add cygwin to your PATH.
 * Microsoft DirectX SDK November 2008. Install x86 Headers and Libs.
 * Windows SDK 6.1. The only required portion is Developer Tools > Windows x86 Headers and Libraries. On Windows 7 64 bit, you'll also need the 32 bit development tools (otherwise rc.exe isn't found).
 * Quicktime SDK 7.3 or higher. Must be installed to your Program Files directory on C:\.

Optional

 * Git. Only necessary if you're interested in using the latest source or contributing. See the git primer page for installation instructions.

Downloading Source Code

 * For Stable builds (aka released versions), check the Downloads page for archives.
 * For Experimental builds, see our [github repo http://github.com/imprudence/imprudence/tree/exp
 * Source can be downloaded manually as an archive, or if you know how, by using Git.

Generating Build Files
Once the source is unpacked, the next step is to run the command to generate the project files. This will also automatically do a few things:


 * 1) Automatically download a bunch of software libraries and unpack them in the linden/libraries/ folder to be used later when compiling. This will take a while, depending on the speed of your internet connection, but the good news is it only has to download once, not every time you compile.
 * 2) Create project files to use for compiling with Visual Studio. CMake creates a separate directory for compiling and storing the project files. The exact directory name depends on your Visual Studio version.

Open up a cmd window (Start > Run > "cmd") and type:

cd C:\imprudence\linden\indra python develop.py

(Note: you'll never use the --standalone flag on Windows.)

If you have multiple versions of Visual Studio installed, use the -G flag to specify a version to generate a solution for, e.g.:  where:


 * VC71 = VS2003
 * VC80 = VS2005
 * VC90 = VS2008

Or, browse to  directory and double-click on "develop.py.bat" to run it with ActivePython.

(Note: develop.py will always find a Visual Studio version before the VC++ Express Edition.)

Project files are generated in:


 * (e.g. )

Compiling Imprudence
Now for the actual compiling! Compiling for the first time can take anywhere from 15 minutes to a couple of hours, so now'd be a good time to start thinking about that dirty laundry you've been puttying off doing (yes, we know about it!).

Visual Studio 2005

 * 1) After develop.py has completed, either browse to your newly created   directory and double click on Imprudence.sln, or open the solution file directly from Visual Studio.
 * 2) The default StartUp Project should be "imprudence-bin" (you can tell because it's bold). If not, make it so by right clicking "imprudence-bin" and selecting "Set As StartUp Project".
 * 3) There will be three build options: ,  , and  . We recommend building  .
 * 4) Go grab some lunch, a full build takes a while.
 * 5) Your final compiled .exe and dlls are in  . You can run imprudence-bin.exe from within Visual Studio.
 * 6) If you want to run Imprudence outside of the debugger, run develop.py with  . A "package" project will be added to your solution, which will copy all the files needed to run Imprudence to a new "packaged" directory inside.
 * Note: if you make any changes to the files in, such as editing an xml file, you'll need to build the package project again to copy them over.

Visual Studio 2008

 * Use  to specify Visual Studio 2008.
 * Follow the Visual Studio 2005 steps above.

Visual Studio 2010
Currently under development! See Nicky Perian's repo on GitHub.

Visual C++ 2005/2008 Express Edition

 * Configure VC++ Express by going to Tools > Options > Projects and Solutions > VC++ Directories and adding the following paths to the top of the matching list (upper right dropdown). The ones listed here are default installations; use your local versions:
 * Executable files:
 * (add this to the bottom of the list!)
 * Include files:
 * Library files:
 * Imprudence's version of develop.py should find your Express installation, but if not, you need to specify the version with  (or   for 2008). You made need to use the VS prompt instead of the regular command prompt to run develop.py.
 * CMake will die when it gets to VStool. Don't worry, this is expected due to differences between the regular and Express version. your solution file has already been created.
 * Open Imprudence.sln in the newly created directory and right click on imprudence-bin. Select "Set As Startup Project."
 * Right click imprudence-bin again and select properties. Under Configuration Properties > Debugging, set the Working Directory to "..\..\newview"
 * Follow the Visual Studio 2005 steps above.
 * Imprudence's version of develop.py should find your Express installation, but if not, you need to specify the version with  (or   for 2008). You made need to use the VS prompt instead of the regular command prompt to run develop.py.
 * CMake will die when it gets to VStool. Don't worry, this is expected due to differences between the regular and Express version. your solution file has already been created.
 * Open Imprudence.sln in the newly created directory and right click on imprudence-bin. Select "Set As Startup Project."
 * Right click imprudence-bin again and select properties. Under Configuration Properties > Debugging, set the Working Directory to "..\..\newview"
 * Follow the Visual Studio 2005 steps above.
 * Follow the Visual Studio 2005 steps above.

Generating The ChangeLog
The ChangeLog project requires git installed to run. If you don't have git already installed and added to your system PATH, see here for installing it, then add   (or whatever the path is to your git.exe application) to the bottom of Tools > Options > Projects and Solutions > VC++ Directories > Executable Files.

Compiling Windows Libraries
OPTIONAL! If you are feeling brave, you can compile the viewer's libraries for yourself. See User:McCabe/Win_build for Imprudence-specific library compile instructions (currently out of date). Any library not yet there can be found here.

CMake 2.8.x errors on Windows Vista/7
Be sure you're running Visual Studio as an Administrator. The best way to fix is this to right click devenv.exe, select Properties, Compatibility tab, and check "Run this program as an administrator".

Boost errors using Visual C++ Express
There's a chance you might see something like:

You'll need to cast whatever's in the boost function as (boost::function). See this forum thread for more info.

Error PRJ0019 when building
See this thread for an explanation and workaround.

Error: the command 'cmake' was not found
Reinstall CMake and add it to your system PATH.

AttributeError: 'WindowsSetup' object has no attribute '__name__'
develop.py isn't finding your version of Visual Studio. You need to specify it by using the -G command flag, e.g.:

(or -G VC90 for 2008).

LINK : fatal error LNK1104: cannot open file 'user32.lib'
More than likely, you're using the VC++ Express Edition and it's trying to link using the cygwin version of link.exe rather than VC++'s. Make sure C:\cygwin\bin isn't in your PATH or your VC++ Executable options. Clear your CMake cache (delete your indra/build-*/CMakeCache.txt file) before running develop.py again.


 * NOTE: If you get " fatal error LNK1104:can not open file 'user32.lib'" error with VC++ Express 2005, then use windows update or click the link in Necessary Software to get "Visual Studio 2005 Express Editions Service Pack 1", then update the service pack with another service pack: these instructions work for Windows 7 32bit; or see here. Finally, you must add the location "C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib" to the list of Lib directories in Visual C++ Express under menu Tools->Options->Projects and Solutions, VC++ directories->Library files (see Visual C++ 2005/2008 Express Edition section above).

LNK1181: cannot open input file 'libgstvideo-0.10.lib
If you see the error  CMake didn't find the right GStreamer library names (this was fixed in 1.2). Edit GStreamer.cmake with the right values, or right click imprudence-bin > Properties > Linker > Input > Additional dependencies and make sure these are the file names listed: libgstvideo.lib libgsttag.lib libgstsdp.lib libgstrtsp.lib libgstrtp.lib libgstriff.lib libgstreamer-0.10.lib libgstpbutils.lib libgstnetbuffer.lib libgstnet-0.10.lib libgstinterfaces.lib libgstdshow.lib libgstdataprotocol-0.10.lib libgstcontroller-0.10.lib libgstbase-0.10.lib libgstaudio.lib libgstapp.lib

viewer_manifest.py errors at the end of a build on Windows
More than likely you'll see something like this:

27>-- Rebuild All started: Project: package, Configuration: Debug Win32 -- 27>Deleting intermediate and output files for project 'package', configuration 'Debug|Win32' 27>Generating Debug/touched.bat

...

27>Processing relwithdebinfo/imprudence-bin.exe => imprudence.exe ... Traceback (most recent call last): 27> File "/Imprudence 1.3.0 beta 1/linden/indra/newview/viewer_manifest.py", line 1113, in 27>    main

This is an error due to the "package" project that generates files for the installer in 1.3 b1. The files generate fine, but the error can be annoying. You can disable the "package" project by going to ALL_BUILD > Project Dependencies and unchecking "package."

BISON-NOTFOUND or FLEX-NOTFOUND
Also the cause of  when linking imprudence-bin.

You didn't install bison or flex when you installed cygwin. Install them, then delete \linden\indra\build-vc80\lscript\lscript_compile\lscript_compile.vcproj and run develop.py again. lscript_compile should now build.