mex compile is not working

조회 수: 1 (최근 30일)
steven fraser
steven fraser 2015년 1월 6일
편집: Martin Gulan 2015년 1월 9일
I have installed the Microsoft Visual C++ 2010 compiler. I am running 64 bit matlab on a 64 bit machine, matlab 2010b. The compiler works when running stateflow models.
When I try to mex a .c file I get this:
>> mex write_c.c
C:\Users\STEVE~1.FRA\AppData\Local\Temp\mex_4UINXY\write_c.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
C:\PROGRA~1\MATLAB\R2010B~1\BIN\MEX.PL: Error: Link of 'write_c.mexw64' failed.
??? Error using ==> mex at 208
Unable to complete successfully.
What is wrong?
  댓글 수: 1
Titus Edelhofer
Titus Edelhofer 2015년 1월 6일
Hi Steven,
just to be sure: I assume you wrote
mex write_c.c
and the "C:\Users\..." is already the error message. Try
mex -v write_c.c
and take a look at the output (or post it here for help) ...
Titus

댓글을 달려면 로그인하십시오.

답변 (1개)

Aditya Jain
Aditya Jain 2015년 1월 8일
The issue arises due to a Microsoft product bug where if you have installed Visual Studio 2010 Service Pack 1 on a system with Windows SDK 7.1, then the x64 compilers and Visual C++ libraries are removed.
You can access the following link for more information on this:
The following link from Microsoft provides a resolution to the issue:
The download page for the update of the SDK compilers is mentioned below:
  댓글 수: 1
Martin Gulan
Martin Gulan 2015년 1월 9일
편집: Martin Gulan 2015년 1월 9일
Dear Aditya 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.
Martin

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by