Invalid PLATFORM variable - building projects on HP computers fails

Abstract: HP Computers include an environment variable name PLATFORM which is used by the build system

The build system uses an environment variable named PLATFORM. Valid values are "Win32", "Win64", or "OSX32". When PLATFORM is set to any other value all builds will fail with the error:

Invalid PLATFORM variable "(value)". PLATFORM must be one of the following: "Win32", "Win64", or "OSX32".

Having the PLATFORM enviornment variable set wrong will also cause syntax highlighting in the IDE to report legal syntax as illegal.

HP computers commonly have this environment variable set, but we can find no way that it gets used.

For most situations, the way to solve this problem is remove the PLATFORM environment variable from your system. Here are steps to do so:

  1. Right click on My Computer. Depending on your OS, this may be from your desktop, or from Windows Explorer.
  2. Select Properties.
  3. Depending on your OS, select either the Advanced tab, or Advanced system settings
  4. Click the Environment Variables button
  5. Find the Platform environment variable and click the Delete button.

If you find you system needs the PLATFORM environment variable, it must be overridden in the RAD Studio IDE or passed explicitly on the command line to MSBuild; for example, /p:Platform=Win32. To override the setting the RAD Studio IDE, select  Tools | Options, Environment Options, Environment variables. Then click New and a variable named platform, with a value of Win32, Win64 or OSX32.