4

I've just installed Delphi XE5 since I wanna try to develop with android.

But I cannot compile anything because I always get an error message. This is the error I get while I compile:

[Error Error] Invalid PLATFORM variable "MCD". PLATFORM must be one of the following: "Win32", "Win64", "Android", "iOSSimulator", "iOSDevice", or "OSX32". If PLATFORM is defined by your system's environment, it must be overridden in the RAD Studio IDE or passed explicitly on the command line to MSBuild; e.g., /p:Platform=Win32.

yonojoy
  • 5,486
  • 1
  • 31
  • 60
Alberto Rossi
  • 1,800
  • 4
  • 36
  • 58
  • 1
    This looks like VCL application. – David Jashi Sep 13 '13 at 21:30
  • Don't mind it, the IDE will find the units. It's probably an error of "error insight". Like in this question: http://stackoverflow.com/questions/6077190/delphi-xe-shows-at-least-200-errors-but-the-program-compiles-just-fine – Sertac Akyuz Sep 13 '13 at 21:31
  • @DavidJashi lol it is a VCL application... – Alberto Rossi Sep 13 '13 at 21:32
  • 2
    A search maybe, would find links that suggest editing system environment variables. – Sertac Akyuz Sep 13 '13 at 21:49
  • 2
    Wait, so you want to develop for Android, but yet you're trying to build a VCL app? Did you start a new Firemonkey app or a VCL app? Did you even read anything about how to build for Android? Also, Delphi isn't Borland anymore - now it's Embarcadero. – Jerry Dodge Sep 13 '13 at 23:02
  • File->New->FireMonkey Mobile Application works fine for me. Maybe you should read the documentation? That's also not the first page you see when you start the IDE. You see the welcome page with links to configuring for mobile development. I have no clue where you went from there, but it isn't where I did (and said in my first sentence above). – Ken White Sep 14 '13 at 02:13
  • 5
    It is not a duplicate (voting to reopen). Besides, I can't see reasons for downvoting this at all. It is pretty well formed and useful question in my view. – TLama Dec 31 '13 at 10:03
  • @TLama judging by comments and the question, the OP has absolutely no idea of what they are doing and didn't even read basic tutorials before wasting others' time. Voting to leave closed. – ivan_pozdeev May 15 '16 at 01:50
  • @ivan_pozdeev I do not agree. The screenshot is misleading, but otherwise the question is okay and in no way a duplicate of the other. If you happen to own a HP notebook and install Delphi the this error message is what you get, if you try to compile and run even the most simple program. – yonojoy May 15 '16 at 10:57

1 Answers1

8

It seems to me your error message is pretty clear.
Select Tools --> Options --> Environment Variables and override the PLATFORM variable.

Have you tried this?

Disillusioned
  • 14,635
  • 3
  • 43
  • 77
  • 7
    The PLATFORM variable is set during compile depending on the selected platform in the project. BUT: this will only work if PLATFORM is not defined on the OS level. The correct way is to remove this variable from the OS environment. This is exactly what the error message suggests. – Uwe Raabe Sep 14 '13 at 10:47
  • 3
    On my HP notebook this `PLATFORM` environment variable is predefined by HP (and set to `MCD`) causing the [conflict with MSBUILD](https://delphihaven.wordpress.com/2011/09/01/xe2-or-more-exactly-msbuild-vs-hp-notebooks/). An other option is to totally remove this variable from the system. – yonojoy May 14 '16 at 23:31
  • 1
    @yonojoy While I agree that would work to fix Delphi; the fact that HP predefines the variable might be significant for some or other utility bundled on the notebook. So removing it might have other unintended consequences. (_I'd wager the odds favour that if it does break anything, it would only break dodgy bloatware you're better off without._) But, since fixing the problem within Delphi is an option, it neatly avoids any unintended side-effects. – Disillusioned May 15 '16 at 01:20
  • 1
    I agree. I just wanted to point out this other solution and provide an explanation. For me the error message *was not clear*. But it solves the problem +1. – yonojoy May 17 '16 at 09:01
  • Thank you @yonojoy - I was working all day with a new installation of Rad Studio 10.1 Berlin, and your comment made me look at the PLATFORM environment variable in Windows. Deleting it solved my problem. Now Win32 and Win64 get defined as desired. – lkessler Jan 14 '17 at 06:05