mex compile is not working
2 次查看(过去 30 天)
显示 更早的评论
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
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
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
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
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!