Talk:Compiler Choices

From Valve Developer Community
Revision as of 17:54, 22 January 2013 by Basiclife (talk | contribs) (Q Re: VS2012)
Jump to: navigation, search


Does anyone have any information re: compilation under VS2012? Basiclife 16:54, 22 January 2013 (PST)

Previous untitled comment

If I remember correctly there is a Visual C++ .NET Framework SDK package available from Microsoft that contains the compiler without the IDE. It would be difficult to use, considering you would have to organize, edit, and compile files all using different programs, but it could be done for a low cost solution.

--Beans-v6 22:32, 16 Sep 2005 (PDT)

What it is is the compiler and linker from Visual C++ 2003. --Pon 00:20, 17 Sep 2005 (PDT)

I have been attempting to build the SDK with MinGW (the Win32 port of GCC). The SDK already provides a makefile for Linux, and I have already modified this for use with MinGW. The Linux makefile works by parsing the Visual Studio project file and converting it into a new makefile. As Visual Studio project files are XML files, it does this using the Xerces XML parser, and requires that this be installed. It also requires version 3.4.1 or newer of gcc/MinGW.

However, this alone is not enough to get it to compile. The first issue the compiler runs into (there could well be others) is what I can only call an error on Valve's part.

Certain bits of the code in the SDK use preprocessor conditionals to do different things in Windows vs. Linux. The first example the compiler runs into (and subsequently fails on) is in the file public\tier0\fasttimer.h (from the mod's root directory) line 271.

The issue is very simple, and is nicely summed-up here. In short: the macro _WIN32 is defined by both Visual Studio and MinGW to mean the code is being compiled on a Win32 system. The Linux makefile defines the macro _LINUX to mean the code is being compiled on Linux. However, the code MinGW needs is (I think; bear in mind I haven't actually compiled this yet) the code in the _LINUX conditionals and not the code in the _WIN32 conditionals.

In other words, the _WIN32 conditionals should actually be _MSC_VER conditionals, as they really mean "use this code when compiling in Visual Studio" not "use this code when compiling in Windows."

There are two solutions I can think of:

  • Somehow undefine _WIN32 in MinGW, or
  • A global search and replace of #ifdef _WIN32 with #ifdef _MSC_VER. Updates as I make progress. MightyMooquack 15:23, 3 Jul 2005 (PDT)
Adding -U_WIN32 to the compiler flags /seems/ to have cleared that up. Other issues have cropped up. Stay tuned. MightyMooquack 15:46, 3 Jul 2005 (PDT)

Free Visual C++

Educational version of VS for free? Very doubtful. There is, however, the Visual C++ Express Edition Beta, available for free at ( —Maven (talk) 12:32, 22 Sep 2005 (PDT)

This is now out of beta and available for free for the next year (meaning it's free as long as you get it within the next year): [1]. As it seems like C++ is what you'd want, I suggest going straight here. Unsigned comment added by Alph Tech STUART (talkcontribs). Please use four tildes (~~~~) to sign your username.

DirectX SDK version

Other pages on this site specifically mention the March 2008 version of the DX SDK. Does the version matter? --TomEdwards 03:29, 15 Aug 2008 (PDT)

Not really, since the compiler doesn't really mind which version you use. It really just depends on the updates included with the newer versions to make a difference.

It will probably be the same when a new version comes out, then we'll update all the pages again with that, or the June version.--Gear 11:11, 15 Aug 2008 (PDT)


Why is this page an exact duplicate of the page titled "Compiler_Requirements"? Merge or deletion needed.

It's a redirect, not a duplicate. See Compiler_Requirements Risugami 01:31, 18 February 2010 (UTC)