17

Building a Windows 8 app, developers can choose HTML/JavaScript, XAML/.Net (C#/VB), and XAML/C++. I want to write my app in XAML/C++.

Building applications in the first two choices almost guarantees that your application will execute on both Intel and ARM architectures.

But I have heard that if I do certain things in my C++ app, I can cause the application NOT to execute on the ARM architecture. But I don't know the details.

Does anyone know what C++ Windows 8 apps should avoid so that they can run on ARM okay? Are these architecture decision or just differences in technique?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
  • 4
    `cpp` is a file extension, you probably mean C++. – Tamara Wijsman Oct 22 '12 at 17:12
  • AFAIK - any application written using Metro should work on any of the Windows 8 platforms. – Natalie Adams Oct 22 '12 at 17:45
  • Provided you only use the Modern UI profile you should be fine. You need to be less broad for us to really help you. Your question is not clear, asking if something is "FUD", is a discussion topic and a bit fit for Stackoverflow. – Security Hound Oct 22 '12 at 17:49
  • See [Can the ARM version of Windows 8 only run Metro (WinRT) style apps?](http://stackoverflow.com/questions/7541919/can-the-arm-version-of-windows-8-only-run-metro-winrt-style-apps?rq=1) – Bo Persson Oct 22 '12 at 18:04
  • If you don't compile for ARM, it can't run on ARM. JS and .Net do not compile to machine code directly, so apps in those languages can work on any architecture. – Gabe Oct 22 '12 at 18:43
  • MFC - http://stackoverflow.com/questions/11352542/vc-metro-style-apps-windows – Software_Designer Oct 23 '12 at 05:05

4 Answers4

3

In order to run on each architecture you first need to compile for each architecture obviously. If you write standard C++ (and if you do not rely on undefined behaviour and/or platform specific behaviour) you are fine the things that usually cause troubles when porting between architectures is:

(this list is an example)

  • sizes of int, long, long long (and others) can differ between platforms
  • signedness of char
  • how structures are padded
  • binary layout of floats
  • endianess
  • and more so on.

Usually you are safe if you refrain from crazy pointer arithmetic and casting.

mauve
  • 1,976
  • 12
  • 18
1

I'm not aware of anything that will make your code simply not execute or compile under ARM (other than inlining assembly).

However, there are things you can do which will make ARM give the wrong answer.

ARM processors are "weakly-ordered" this recent article gives you the low down

http://preshing.com/20121019/this-is-why-they-call-it-a-weakly-ordered-cpu

But to sum up, ARM processors may reorder memory accesses, and if you aren't careful, this can give you different results between x86 and ARM architectures in multi-threaded applications.

OmnipotentEntity
  • 16,531
  • 6
  • 62
  • 96
0

ARM is only supported for Windows Store apps.

System Requirements

Supported Architectures: The Windows SDK for Windows 8 supports building applications for the following architectures: x86 x64 ARM (Windows Store apps) Note: The Windows SDK for Windows 8 cannot be installed directly on the ARM architecture. You can install the Windows SDK on an x86 or x64 platform, in order to build applications that target the ARM architecture.

Here is a link to the article that you can refer to.

Konstantin Dinev
  • 34,219
  • 14
  • 75
  • 100
0

MFC applications will not run on ARM based Windows 8 systems .

You can build Metro style applications using C++ , you just have to follow the Metro "style" guidelines.

Change your program to use HTML/CSS or XAML and the WinRT APIs instead of MFC and the Win32 APIs if you want all of your program to support ARM based Windows 8 systems as well as x86 based systems.

Software_Designer
  • 8,490
  • 3
  • 24
  • 28