0

While building the project in VS2012, I'm getting the linking error as

LNK1113: invalid machine type 0x1C0

I'm not sure where to check and what would be the error. Any help would be appreciated.

Thanks

Matt
  • 179
  • 1
  • 3
  • 14
  • I'm not totally familiar with VS2012, however, there is a setup or project parameter that indicates the target architecture. That parameter needs to be either 1) blank or 2) set to the actual value to represent the current architecture/cpu – user3629249 Jul 28 '15 at 19:49
  • Sounds like it might be a corrupt obj. The best advice seems to be to remve the offending obj and rebuild. https://social.msdn.microsoft.com/Forums/en-US/02a7479f-0f07-4d91-8ce6-c7f574b1e02c/lnk1113-invalid-machine-type-0x1c0?forum=vcgeneral – user590028 Jul 28 '15 at 19:49
  • Well, it is not an invalid machine type but the linker doesn't speak that language. 0x1C0 is the machine type for ARM cores. Surely you are using the wrong library, contact your library vendor/supplier to obtain the correct flavor. – Hans Passant Jul 28 '15 at 20:15

1 Answers1

-1

two minutes google for 'how to set module machine type in visual studio'

resulted in the following info, found at:

<http://stackoverflow.com/questions/3563756/fatal-error-lnk1112-module-machine-type-x64-conflicts-with-target-machine-typ>



Check your properties options in your linker settings at: 
Properties > Configuration Properties > Linker > Advanced > Target Machine. 
Select MachineX64 if you are targeting a 64 bit build, 
or MachineX86 if you are making a 32 bit build.

Select Build > Configuration Manager 
from the main menu in visual studio. 
Make sure your project has the correct platform specified. 
It is possible for the IDE to be set to build x64 
but an individual project in the solution can be set to target win32. 
So yeah, visual studio leaves a lot of rope to hang yourself, 
but that's life.

Check your library files 
that they really are of the type of platform are targeting. 
This can be used by using dumpbin.exe 
which is in your visual studio VC\bin directory.
use the -headers option to dump all your functions. 
Look for the machine entry for each function. 
it should include x64 if it's a 64 bit build.

In visual studio, select 
Tools > Options from the main menu. 
select Projects and Solutions > VC++ Directories. 
Select x64 from the Platform dropdown. 
Make sure that the first entry is: 
$(VCInstallDir)\bin\x86_amd64 
followed by $(VCInstallDir)\bin.

Once I did step 4 everything worked again for me. 
The thing was I was encountering this problem on all my projects 
where I wanted to compile towards a 64 bit target. 
user3629249
  • 16,402
  • 1
  • 16
  • 17