Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Windows Phone Native Series - Solving "Fatal error LNK1112: module machine type 'ARM' conflicts with target machine type 'X86'"

DZone's Guide to

Windows Phone Native Series - Solving "Fatal error LNK1112: module machine type 'ARM' conflicts with target machine type 'X86'"

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

As I was working on my native wrapper for Windows Phone, I somehow managed to break the build process. Although there were no modification on my side, on invoking the Build command I would get this:

Not exactly what I was expecting, and I needed to solve this in order to get my DLL. The problem lies in the machine type declaration that is passed to the linker. For some reason, mine got cleared, and therefore the default architecture was set to X86, which is obviously the wrong choice. To change this, you can go two ways.

1. Change the target machine by selection.

Right click on the project and select Properties. Select Linker and open the Advanced item.

Select the Target Machine property and modify it to MachineTHUMB (/MACHINE:THUMB) (what in the world is THUMB?).

2. Add the /MACHINE parameter manually.

Opening the same Properties dialog, in the Linker section, select Command Line. In Additional Options, add a space and type: /MACHINE:THUMB.

You're all set and ready to continue working now. The solution is that simple. Here are some more details on the /MACHINE parameter.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}