31

I was working with visual studio 2012 beta and my desktop (win32) program compiled fine in ARM architecture.

After upgrading to visual studio 2012 RC, the compiler would not work and spews out the following error:

"Compiling Desktop applications for the ARM platform is not supported"

I found a forum post on this http://connect.microsoft.com/VisualStudio/feedback/details/745580/arm-configuration-doesnt-work

Is it correct that Microsoft is really cutting off win32 development on ARM? And that compiling in VS2012 beta was just a fluke?

4
  • 2
    Yes, you read that connect posting correctly. Windows RT (windows 8 for ARM) does not support third party desktop applications. As such, there's no support for developing them in visual studio.
    – Jon
    Jun 28, 2012 at 17:58
  • If you're an MSDN subscriber or have access to Windows Phone/Mobile code, You should have a look at cl.exe
    – sgupta
    Sep 28, 2012 at 6:20
  • 1
    Now that some clever people have worked out how to run non-Microsoft-signed code on Windows RT, mamaich's solution is quite useful. Unfortunately, it's likely you'll find some important LIBs are missing for ARM if you try to re-compile your program. no2chem posted a thread on XDA Developers explaining how to convert DLL files to LIB files (you'll need the DLLS from a Windows RT device).
    – Quppa
    Feb 1, 2013 at 11:20
  • I had a DLL that was doing this. If I wanted to use that DLL in a C# and XAML app, is it still a "Desktop Application"?
    – jocull
    Sep 8, 2013 at 20:27

4 Answers 4

47

You can edit the file:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\ARM\Microsoft.Cpp.ARM.Common.props

In the <PropertyGroup> section add the line:

<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>

before </PropertyGroup>

And that's all, you can build ARM desktop apps with VS2012.

7
  • Please check if this file is opened in another program. How to modify it ?
    – onmyway133
    Jun 21, 2013 at 8:53
  • @mamaich - I don't mean to sound rude, but did Microsoft approve this? (I'm looking for a Microsoft approved method to avoid the error since this is a real project, and not an XDA-like hack (no offense to the XDA folks)).
    – jww
    Aug 7, 2013 at 5:34
  • Ah, this is interesting... the trick only fixes the IDE. If you drop into the command line, you still get the error. In hind sight, it makes sense.
    – jww
    Aug 7, 2013 at 6:49
  • @jww for a professional project, why not use a supported ARM cross compiler, like GCC, etc? Jul 9, 2014 at 7:13
  • 2
    In case of VS2017 I have modified following file and it worked just fine: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Platforms\ARM64\PlatformToolsets\v141\Toolset.targets
    – miradham
    Dec 13, 2017 at 1:27
10

I was able to get around that error and compile a little "hello world" cpp file for ARM by adding the "/D _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE" command-line argument to the ARM version of cl at C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm. I found that #define from sn0w's answer on this question in the crtdefs.h file, without having to modify that file. Now, I can't guarantee that anything more complex will actually work, or that Microsoft hasn't instituted some sort of whitelisting or digital signature verification for Windows RT desktop apps, so even though it may compile, it may not be allowed to run when Windows RT is finally available.

Note that before you can run the ARM version of cl.exe from the command line, you must set the environment variables using this batch file: "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"

1
  • 2
    Just a nit pick: when using mamaich's trick to compile under Visual Studio, VS applies /D _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1.
    – jww
    Aug 7, 2013 at 7:21
4

Even if you compile the app, you won't be able to run it on Windows 8 RT as unsigned apps will not start.

I just tested this, and unfortunately it is the case.

You receive the following message:
Windows cannot verify the digital signature of this file

I imagine there is probably a work around for this, but it will never be officially supported.

1
3

yes of course. i practised with VS2012 RC. now i'll explain how to avoid "Compiling Desktop applications for the ARM platform is not supported" and build win32 application.

1st way: fix build tools - the goal is to patch (or try to substitute it with beta's one) MSBuild's lib: Microsoft.Build.CPPTasks.Common.v110.dll

2nd way: run the "VS2012 ARM Cross Tools Command Prompt" from Visual Studio Tools start menu, then execute cl [cl params] myfile1.cpp myfile2.cpp myres.res ... /link [linkparams]

for both this cases you also need to commentout an #error directive in crtdefs.h on line 332. (Microsoft Visual Studio 11.0\VC\include)

Not the answer you're looking for? Browse other questions tagged or ask your own question.