Error using mex for compiling unravel.c

Hi all, I am trying to run mex compiler for unravel.c. However, it always show the error:Error using mex (line 206)Unable to complete successfully.
Although I have try some solution such as download update for Microsoft Visual Studio 2010, the problem keep happening.
Can anyone please help me?
Thank you
PS: I am running MATLAB R2012a and using Microsoft Visual Studio 2010 Express Edition on a 64bit laptop (windows 7).

9 Comments

Please show us the complete output of the mex command.
This is the output of the mex commmand:
C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: Compile of 'unravel.c' failed.
Error using mex (line 206)
Unable to complete successfully.
Thank you.
Odd. What does
mex -setup
show ?
************************************************************************* Warning: MEX-files generated using Microsoft Windows Software Development Kit (SDK) require that Microsoft Visual Studio 2010 run-time libraries be available on the computer they are run on. If you plan to redistribute your MEX-files to other MATLAB users, be sure that they have the run-time libraries. *************************************************************************
Trying to update options file: C:\Users\Vinci\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2012a\bin\win64\mexopts\mssdk71opts.bat
Done . . .
************************************************************************ Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html Building with the -largeArrayDims option enables the new API. ************************************************************************
You got that for
mex -setup
and it did not ask you which compiler to use?
That's strange - on my computer, it says this:
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2012b/win64.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Are you sure it didn't just fail to compile because you have a syntax error?
Sorry. I just show the last part of the setup.
Yes, it did ask me to choose the compiler. Here is the complete report:
mex -setup
Welcome to mex -setup. This utility will help you set up a default compiler. For a list of supported compilers, see http://www.mathworks.com/support/compilers/R2012a/win64.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler: [1] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0
[0] None
Compiler: 1
Please verify your choices:
Compiler: Microsoft Software Development Kit (SDK) 7.1 Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
************************************************************************* Warning: MEX-files generated using Microsoft Windows Software Development Kit (SDK) require that Microsoft Visual Studio 2010 run-time libraries be available on the computer they are run on. If you plan to redistribute your MEX-files to other MATLAB users, be sure that they have the run-time libraries. *************************************************************************
Trying to update options file: C:\Users\Vinci\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2012a\bin\win64\mexopts\mssdk71opts.bat
Done . . .
************************************************************************ Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html Building with the -largeArrayDims option enables the new API. ************************************************************************
What directory are you in at the time you try to do the compile?
A folder inside the C disk. I tried somewhere else. But it still doesn't work.

Sign in to comment.

 Accepted Answer

Image Analyst
Image Analyst on 22 Dec 2012
Edited: Image Analyst on 22 Dec 2012
The free versions of Microsoft products are limited in many ways. For example the "starter edition" of Office won't let you talk to it from MATLAB via ActiveX. A while ago I remember that I encountered some limitation with the Express (free) edition of Visual Studio but I don't remember what it was. Perhaps you're running into something like that. Ask someone who has the full version of Visual Studio to compile it for you, or switch to another compiler.

5 Comments

Thank you for your advice. I have used compiled files from my friend and it works for my project.
However, I cannot still compile the C file on my computer.
DO you mean that you compiled files on your computer that your friend gave you and they compiled fine on your computer? But yours don't? I just want to make sure you're not saying that you compiled your files on your friend's computer.
I mean my friend compile the C code for me on his computer and I use it for my project successfully. But I cannot compile on my computer.
Image Analyst
Image Analyst on 24 Dec 2012
Edited: Image Analyst on 24 Dec 2012
Your Visual studio Folder is in Program Files (x86), which is often a folder meant for 32 bit applications. Yet you are trying to compile with 64 bit MATLAB because I see win64 in this folder: C:\PROGRA~1\MATLAB\R2012a\bin\win64\. I never try to mix things like that. Are you sure that your version of Visual Studio is a 64 bit app and you're trying to compile in 64 bit MATLAB? Is it possible that the free "Express Edition" of Visual Studio only comes in a 32 bit version? What version of Visual Studio does your friend have - the Professional version or the Enterprise version? Are you sure BOTH you and your friend have the compiler? It's so expensive that usually only one person in an organization has it. Type "ver" on the command line and report what it says back here.
Vinh Nguyen
Vinh Nguyen on 24 Dec 2012
Edited: Vinh Nguyen on 24 Dec 2012
Actually, I firstly installed the SDK 7.1, which seems to be the 32 bit application. When I installed the SDK, I see no option for 64 bit. It does not work for me. Then I find the solution at http://www.mathworks.com/support/solutions/en/data/1-G1P8HP/
May be the problem is the combination of 32 bit SDK and 64 bit Matlab.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!