Problem compiling mex file in Matlab Coder. "'bin' is not recognized as an internal or external command, operable program or batch file."
Show older comments
Even when attempting to compile the trivial function:
function r = testCoder(x1,x2)
r = x1 + x2;
end
I am unable to compile functions to mex files in the MATLAB Coder. I have no trouble when compiling to C/C++ Static Library.
I get the error:
??? Build error: Compilation returned error status code 255. See the target build log in the report for further details.
and the report states:
'bin' is not recognized as an internal or external command, operable program or batch file.
I am using 2012b (32-bit) and have already run mex -setup and selected "Lcc-win32 C 2.4.1" as my compiler.
10 Comments
Image Analyst
on 13 Jul 2013
Edited: Image Analyst
on 13 Jul 2013
What does your compilation line look like? Your mcc or mex line? What does the rest of the error (the part you omitted) look like? Post all it reports, don't just cut out a small part.
John
on 15 Jul 2013
Lokesh Ravindranathan
on 15 Jul 2013
Could you also tell me from where you are trying to compile (directory of the m file)?
Could you try generating code using the following syntax:
codegen testCoder -args {2,3}
You could paste the error message if generated using the command line syntax too.
John
on 15 Jul 2013
Fred Smith
on 15 Jul 2013
Hi John,
Can you provide the full path to the folder for your MATLAB installation, and for the folder containing your test MATLAB program?
An initial guess is that spaces or other funny punctuation in the path may be causing this problem.
Thanks,
Fred
John
on 15 Jul 2013
Lokesh Ravindranathan
on 17 Jul 2013
The working folder and the test program look to be good. Can you make sure there are not files named testCoder in the path by using
which -all testCoder
Make sure your path is not corrupted. Mex a sample file yprime.c, found in your matlabroot/extern/examples/mex/ folder.
This will check if there is a compiler issue.
John
on 17 Jul 2013
Lokesh Ravindranathan
on 17 Jul 2013
Could you see copy-paste the path of your computer? If you are unable to do so, could you check if there are weird path names.
Ryan Livingston
on 18 Jul 2013
Other things to check are the generated BAT file and Makefiles in the codegen directory. An error like this usually occurs when an unescaped space or other punctuation character is in a path. E.g.:
C:\path\to\some\ bin
could try to run bin. Also, you could check for ampersands (&) in those files and your system path like Lokesh mentioned.
Answers (0)
Categories
Find more on MATLAB Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!