mex compile is not working

6 ビュー (過去 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 Center および File ExchangeIntroduction 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