mex compile is not working

6 visualizzazioni (ultimi 30 giorni)
steven fraser
steven fraser il 6 Gen 2015
Modificato: Martin Gulan il 9 Gen 2015
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 Commento
Titus Edelhofer
Titus Edelhofer il 6 Gen 2015
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

Accedi per commentare.

Risposte (1)

Aditya Jain
Aditya Jain il 8 Gen 2015
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 Commento
Martin Gulan
Martin Gulan il 9 Gen 2015
Modificato: Martin Gulan il 9 Gen 2015
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

Accedi per commentare.

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by