How I compiled Windows 8 (Metro) for x64 and ARM

It seems that the original Windows 8 project, can’t be compiled for ARM and x64.
Only x86 it supported at this stage.

I want to share how I was able to compile it for ARM and x86.

The main reason for it not compiling, it all of the precompiled third party libraries:
zlib, libjpeg, libpng and libxml2.

Their source code is not provided, probably due to licensing restrictions, but their source can be downloaded from the web.
So all you need to do, is add their source to your project, and compile them as part for the project.
The libraries aren’t that hard to compile, expect libxml2, that has many unneeded stuff, like FTP\HTTP communications, that isn’t really needed.
So I have to modify a few defines and remove some unused functions.

Another thing you will need to do, is copy the project settings for each configuration.
It might take some time, don’t forget to copy the pixel\vertex shader file settings for the ARM and x64 configurations.

Good luck :slight_smile:

Oren Bengigi wrote:

It seems that the original Windows 8 project, can’t be compiled for ARM and x64.
Only x86 it supported at this stage.

I can confirm the x86 configuration compiles, runs, and passes WACK (Windows App Certification Kit), without modifications as downloaded from Github.

I want to share how I was able to compile it for ARM and x86.
>
The main reason for it not compiling, it all of the precompiled third party libraries:
zlib, libjpeg, libpng and libxml2.
>
Their source code is not provided, probably due to licensing restrictions, but their source can be downloaded from the web.

My experience with the previous updates of the Cocos2d metro branch is that these libraries used functions that caused WACK to fail. Maybe things have changed, but I think that’s why tinyxml was added for example, and stuff was removed or changed. Please correct me, if I am wrong.

I’m curious as to whether x86 metro executables can run on 64 bit Windows 8, and how well; and whether it is necessary to build for x64, if x86 exe’s work, which I’m guessing that they do.

x86 can run on 64 bit Windows 8, but for the ARM you must compile on ARM.
I didn’t test it on an ARM device (Don’t have any), but it did compile without issues.

And yes, you probably right. Libxml2 uses Windows network API’s that cannot be used with Metro, this is why I had to remove a few functions to make it work.

Oren Bengigi wrote:

x86 can run on 64 bit Windows 8, but for the ARM you must compile on ARM.
I didn’t test it on an ARM device (Don’t have any), but it did compile without issues.

I was about to ask if you tried the RT emulator, but there appears to be no emulator like the one for Windows Phone 7. Yet? Is there or will there be a tie into the Windows Phone 8 emulator?

And yes, you probably right. Libxml2 uses Windows network API’s that cannot be used with Metro, this is why I had to remove a few functions to make it work.

I am guessing that enabling network capabilities in the appmanifest still doesn’t give permission.

Could you let us know which defines you changed to get libxml2 to pass WACK? I’ve disabled http, ftp and threads but my app is still failing WACK (tinyXML is unfortunately too slow for my purposes).