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?

Viesturs
  • 1,691
  • 4
  • 21
  • 25
  • 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 '12 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 '12 at 06: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 08 '13 at 20:27
  • 1
    Now that some [clever people](http://forum.xda-developers.com/showthread.php?t=2092158) 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](http://forum.xda-developers.com/showthread.php?t=2096820) explaining how to convert DLL files to LIB files (you'll need the DLLS from a Windows RT device). – Quppa Feb 01 '13 at 11:20

4 Answers4

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.

Hasturkun
  • 35,395
  • 6
  • 71
  • 104
mamaich
  • 486
  • 5
  • 3
  • Please check if this file is opened in another program. How to modify it ? – onmyway133 Jun 21 '13 at 08: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 07 '13 at 05: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 07 '13 at 06:49
  • @jww for a professional project, why not use a supported ARM cross compiler, like GCC, etc? – BrainSlugs83 Jul 09 '14 at 07:13
  • @onmyway133 I had the same issue, I solved it by opening the file as administrator. – Olivier Jun 15 '15 at 08:05
  • Just with VS 2012? Or can I use VS 2015 Community?? Thanks! – Jesuslg123 Oct 19 '15 at 07:34
  • 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 '17 at 01: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"

Paul
  • 3,748
  • 1
  • 25
  • 28
  • 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 07 '13 at 07: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.

TheCodeArtist
  • 21,479
  • 4
  • 69
  • 130
  • 1
    There's some detail here, towards the bottom, of a possible workaround for this ... http://forum.xda-developers.com/showthread.php?p=31519618&postcount=1 – dodgy_coder Nov 14 '12 at 05:40
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)

sn0w
  • 39
  • 3