Compiler Choices

From Valve Developer Community
Revision as of 16:56, 10 February 2006 by Rof (talk | contribs) (Using other compilers)

Jump to: navigation, search

The SDK is set up to be compiled with Microsoft Visual C++ .NET 2003 v7.1 (No longer available for purchase from Microsoft as Visual Studio 2005 went live somewhere around November).

http://msdn.microsoft.com/howtobuy/visualc/default.aspx.

This solution is, however, commercial and requires you to shell up money to develop a modification for the Source-engine. You can usually get it secondhand for around the price of two or three games.

Using other compilers

There is an Academic version of VS2003.NET available to students or faculty enrolled in college, which has an MSRP of $99. It IS legal to distribute content created with this version, however if Microsoft find out that you're not a student, they will most likely try to put an end to it.

I believe using the SDK with the (relatively) new VS2005 will work just fine: However, at the moment the SDK will not work with the free Visual C++ 2005 Express without numerous code changes. (Valve is reportedly working on this [1]). See also Compiling under VS2005.

The SDK can also be compiled under the older Microsoft Visual Studio 2002 product. Most HL1 mods were made using this older version of C++, so if you're a modder, you may already have it installed. If not, VS2002 may be cheaper to buy than VS2003.NET. VS2002 users see Compiling under VS2002.

Q: The thought occurs that if the SDK can be tweaked to compile on an older version of VS, maybe it could also be tweaked to compile using Dev-C++ or another free compiler. Has anyone ever tried this? How can I do it? Or is it impossible?

A: Dev-C++ is an IDE. The default compiler it uses is called MinGW, which is a Windows port of GCC (the more-or-less standard Linux compiler). Attempts to compile the SDK using MinGW have failed. Getting it to succeed would require a non-trivial amount of work.

Slightly more promising would be using the Visual C++ Toolkit, which is free and has the Visual C++ compiler and linker. It can't, however, parse Visual Studio solution files, getting around which is also a non-trivial task. The advantage is that getting the SDK working with MinGW requires re-writing a suprisingly large number of sections of code, while the VC++ Toolkit merely needs to have a batch file/makefile written for it.

You can now use Visual C++ 2005 Express when compiling by following the tutorial on ChatBear: [[2]]