2

I am using Matlab 2010 and VS2010. I have the Matlab Compiler Runtime installed in my system. Whenever if run command mcc -setup I get only one compiler lcc. This compiler gives a lot of errors when used to build a C++ shared library using deployment tool. It builds only C Shared libraries correctly.

Can I also connect VC++ compiler with MCC ????

How should I do that ??

Animesh Pandey
  • 5,900
  • 13
  • 64
  • 130
  • Taking a look at the [supported compiler list](http://www.mathworks.nl/support/compilers/R2012b/win64.html), it should use VC++ for something. I thought it was mex related. Unfortunately, I do not know these aspects of Matlab enough to help you further. – rubenvb Dec 29 '12 at 14:21

2 Answers2

2

Have you read this article? Especially note 2? They are talking about a similar bug there.

PS

Matlab interacts with compilers using mexopts files, located in

matlabroot\bin\win64\mexopts\

So, you may add virtually any compiler yourself.

  • Some mexopts are available through Mathworks fileexchange.
  • If you've got access to newer matlab installation, you can get mexopts from there.
  • You can write your own set of mexopts, based on existing files. In genereal, it's rather easy make, say VS2010 mexopts out of VS2008 ones.

Here's an official article on this.

Igor
  • 1,359
  • 19
  • 34
  • Can you add links to relevant fileExchange posts with `mexopts`? – Shai Dec 31 '12 at 07:57
  • 1
    @Shai Here's just a copule of examples: [link](http://www.mathworks.com/matlabcentral/fileexchange/20877-mexopts-for-pelles-c) [link](http://www.mathworks.com/matlabcentral/fileexchange/31255-mex-setup-for-windows-x64-intel-c-compiler-12-xe-with-vs2008) You'll be able to find more with search through File Exchange. One may use these as an example to write your own mexopts. (I doubt, that there's a simple VS2010 option. As I've pointed before, one can get MSVS2010 opts [here](http://www.mathworks.co.uk/support/solutions/en/data/1-D5W493/?solution=1-D5W493) ) – Igor Dec 31 '12 at 08:31
0

There is an issue with Matlab 2010 and VS2010. It seems like Matlab was released before VS and therefore it does not have automatic way of configuring VS2010.

I ran into this issue once and my best advice is to download VS2008 express edition...

It's lame, but its the quickest way to get Matlab 2010 working with VS.

Sorry.

Shai
  • 111,146
  • 38
  • 238
  • 371
  • Is there any bug fix for this ? There is one available for `mex -setup` which I used and matlab was able to configure VS2010 compiler. But the main problem is coming in using `mbuild -setup` !!!! – Animesh Pandey Dec 30 '12 at 05:47
  • It is not lame at all! It has worked well and quickly ans without errors! Thanks! – Animesh Pandey Dec 30 '12 at 06:14
  • 1
    @apanimesh061 - it is lame in the sense that Matlab should be able to work with VS2010 as well... – Shai Dec 30 '12 at 07:54
  • Do you know how to use the libraries that are generated by the tool ? I have a lib, dll and cpp file in distrib folder.... !!! – Animesh Pandey Dec 30 '12 at 13:30
  • @apanimesh061 - not sure I understand your question. What libraries generated by which tool? If this is a big question, why don't you post it properly as a new one? – Shai Dec 30 '12 at 13:33