Compiler error

8 views (last 30 days)
Melissa
Melissa on 6 Dec 2011
Commented: Martin Gulan on 9 Jan 2015
Good Afternoon All,
I am having a problem when trying to run the compiler and have figured out it has something to do with VS2010 and matlab.
The error is: error lnk1112 module machine type 'x86' conflicts target machine type 'x64'
Error: An error occurred while shelling out to mbuild (error=2). Unable to build executable.
I cannot figure out how to change either setting and which setting I need to change. I have windows xp and the 64 bit version of both programs. Any help or suggestions are greatly appreciated.
Thanks!

Accepted Answer

Melissa
Melissa on 14 Dec 2011
Problem solved. It was an error with Windows SDK 7.1. When installing you have to unclick the C++ tool kit and install and then download the update to fix the problem.

More Answers (1)

Kaustubha Govind
Kaustubha Govind on 7 Dec 2011
Assuming that you have 64-bit Windows and 64-bit MATLAB, have you installed x64 compilers with your Visual Studio? By default, only the 32-bit compiler is installed - there is a checkbox during installation that you need to select to ensure that x64 Compilers are installed.
Once you have done this, run "mbuild -setup" and make sure that it automatically picks up the installed compiler.
  1 Comment
Martin Gulan
Martin Gulan on 9 Jan 2015
Dear Kaustubha and others;
when I run
>>mex work/obj_target/test.obj work/interface/test_mex.c -output test
I receive almost the same output, i.e.:
Building with 'Microsoft Visual C++ 2012 (C)'. Error using mex work/obj_target/test.obj: fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
on my x64-based machine with Win7_64bit, MATLAB2014a_64bit and Microsoft Visual Studio 2012 . Any advice here, please? I am trying to solve this for days and slowly runing out of time, hence I will appreciate any help a lot.
PS: Then I also get the same problem in Diagnostic Viewer (fatal error LNK1112:...) when trying to build my Simulink model (more precisely when Linking) for my target PC via Simulink Real-Time
Martin

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!