Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

I'm trying to generate code using Matlab Coder, and I've managed to get to the stage where I generate MEX to test the code for run-time issues. However I'm getting a strange error:

Build error: Compilation returned error status code 2. See the Target Build Log in the report for further details

The build log says:

cl /c /Zp8 /GR /W3 /EHs /nologo /MD /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /DMATLAB_MEX_FILE -DMX_COMPAT_32 /O2 /Oy- /DNDEBUG /fp:strict /I "C:\PROGRA~1\MATLAB\R2015a\simulink\include" /I "C:\PROGRA~1\MATLAB\R2015a\toolbox\shared\simtargets" /I "C:\test\MATLAB~1" /I "C:\test\MATLAB~1\codegen\mex\filter" /I "C:\test\MATLAB~1\codegen\mex\filter\interface" /I "C:\PROGRA~1\MATLAB\R2015a\extern\include" /I "." "filter_data.c" filter_data.c c1 : fatal error C1083: Cannot open source file: 'filter_data.c': No such file or directory gmake: * [filter_data.obj] Error 2

I have no idea how to solve this (not sure how I should interpret the error log). The 'filter_data.c' file does exist though, in the codegen\mex\filter folder. It works fine when changing the compiler to lcc, but I'd rather not use that, since in the end I would like to generate C++ code which is not possible with lcc.

share|improve this question
    
It might be complaining about not being able to open a file because some other program has it open. Are you trying to compile in visual studio while Matlab is running? – rost0031 Jun 25 at 15:17
    
At the end of the command line there is "filter_data.c" filter_data.c. Try to remove this part and specify instead the full path to the source file inside quotation marks. – Hadi Brais Jun 25 at 16:25
    
I actually had Visual Studio running, but that was not the problem. @HadiBrais I'm not sure how to do that. The .c files are all generated by Matlab Coder when doing the MEX-generation step. – ein123 Jun 26 at 7:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.