简体   繁体   中英

Installing a C compiler in Matlab

I want to call from MATLAB function from a lib file (compiled in C - probably in MSVS).

All instructions I found on Mathworks get me: "No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler"

I would have followed the instruction but I've noticed this: "Library (.lib) files generated by Microsoft® Visual Studio® are not compatible with MinGW"

So I rather not to. I have MSVS installed on my (windows) computer, I can't find anywhere instructions of how to 'tell' Matlab to work with this compiler.

Any one can point me to instructions how to define a C compiler i Matlab (other than MinGW)?

PS I am using the coder toolbox and generating MEX files all the time so I guess somewhere my Matlab does have access to a C compiler

The options for free C compilers that work with Windows MatLab installs are getting slim. The last time I tried MinGW with MatLab, it was a no go. Visual Studio Community 2017 will not work either. Visual Studio Community 2015 does work if you can find an installer for it. That's what I have deployed in my labs. You can run the MatLab command

mex -setup 

To have MatLab show a list of compatible compilers found on the system, if any. You can also select which compiler for it to use if there are more than one.

OK, solved the issue

I installed the Windows SDK 7.1

SDK 7.1 won't install the C compiler without the .Net 4 installed

.Net 4 comes with Windows 10 BUT the SDK 7.1 does not recognize it

Here how to install SDK7.1 on Win10 I found how to solve this...

Now my Matlab recognize I have a compiler :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM