Matlab (2011b) compiler doesn't compile

6 views (last 30 days)
Sara Iliafar
Sara Iliafar on 13 Feb 2012
Edited: Cedric on 10 Oct 2013
Hi there,
It seems that the 2011b version of matlab has some bug with its matlab compiler. I tried compiling with the 2011b version and it gives me this warning: Warning: an error occurred while parsing class emlcoder.InferenceReport: Undefined function 'findclass' for input arguments of type 'double'. +
After waiting for another while, it gives another warning: Warning: an error occurred while parsing class RTW.TflViewer: Undefined function 'findclass' for input arguments of type 'double'.
and it never compiles. I can compile on a computer with the 2009b version but then it doesnt execute on computers that have the 2011b version. =/
Also, from searching online, it seems that I might have to manually specify the path but I am not totally sure which toolbox I am using
I was wondering if you had any suggestions.
Thank you.

Answers (5)

Andreas Goser
Andreas Goser on 13 Feb 2012
The most frequent issue is that users do not have a supported compiler with their Windows 64 bit installation. Please verify:
  1 Comment
Sara Iliafar
Sara Iliafar on 13 Feb 2012
Hi Andreas,
Thank you for your respond.
I re-installed Microsoft Visual C++ 2010 Express with Microsoft Windows SDK 7.1, and used "mbuild -set up" to tell matlab to use the compiler. Matlab could find the compiler without any problems but I am still getting the same warning message as before and the compiler still cannot compile. :(

Sign in to comment.


Kaustubha Govind
Kaustubha Govind on 13 Feb 2012
You may have already read that I recommended using the "-N -p" option to specify the paths. If you are using a small number of toolbox functions, you can run "which functionname" to find out the path to the toolbox.
Also, please consider reporting this to MathWorks Tech Support.
  2 Comments
Sara Iliafar
Sara Iliafar on 13 Feb 2012
Hi Kaustubha,
Thank you for your reply.
I was able to find the toolbox path but the compiler still cannot compile despite using the -N -p option.
Sara
Kaustubha Govind
Kaustubha Govind on 14 Feb 2012
Sara: Is it still the same error?

Sign in to comment.


David
David on 1 Sep 2012
Hi All,
I simply wanted to share that I am witnessing the exact same error flow as described by the OP. If anyone has found a solution, I would be appreciative if you might take the time to share. Thank you for detailing the problem so precisely, and for the two solutions attempts previously offered.
Regards, David

Matthijs
Matthijs on 26 Oct 2012
Edited: Matthijs on 26 Oct 2012
I experienced the same issue with R2012a, after having successfully compiled the same code on R2010b. Since it's just a warning I ran the compiled executable anyway, but it failed with an "ApplicationRedefinedException". Here's how I fixed the problem (not claiming that this solution works for everyone).
My code makes use of MEX-files generated with EMLMEX, so I figured it had something to do with that. I went through these steps (I'll list them all, even though some did not help to fix the issue). For the impatient, steps 5 and 6 fixed the issue.
1. Converted the scripts used to generate the MEX-files using CODER.UPGRADE
2. Using the converted scripts (that use CODEGEN instead of EMLMEX) re-compiled the MEX files. This did not solve the issue.
3. Changed my main routine to call the regular M-files instead of the MEX-files. This didn't fix the issue.
4. Searched the path for occurrences of "emlcoder". Deleted all files containing occurrences (such as backups generated by coder.upgrade), until there were no more occurrences. This didn't fix the issue.
5. One of the paths containing a MEX-file was included in the mcc command with the -a option. I changed this to the -I option (so that only files that can be determined to be needed at compile time are included). This fixed the issue.
6. However, I need this -a option for this path. I moved the scripts in this path used to generate the MEX-files (the upgraded scripts that don't make use of eml, but of coder) to another directory that is not included in mcc. This fixed the issue.
Hope this helps.

George
George on 29 Oct 2012
Edited: George on 1 Nov 2012
Sara, You may need to reinstall Matlab 2011b after you have installed the Win SDK and compilers. I found that executables created using 2011a would not run on my system despite having all of the necessary components, apparently because during the build process another version of the VC++ redistributable was being specified. However, after reinstalling Matlab, everything worked.
In summary, it seems that Win SDK and its compilers must be installed prior to Matlab being installed. If you did it that way, then I do not know what the solution is, except to upgrade to 2012b.
If anyone has had success getting the Matlab compiler to work with Win SDK and compilers installed afterward, I am interested to know.

Categories

Find more on C Shared Library Integration 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!