Compilation don't work. Why?

Hello.
I couldn't build my project from matlab coder. I had installed microsoft windows sdk 7.1 and i had setup compiler in matlab (mex -setup). When i tried to compile project an error occured: "??? Build error: Build failed for project 'residual_rtw'. See the target build log in the report for further details." When i choose checkbox "Generate code only", MATLAB generated c-code without errors. Please help. I have on my computer: MATLAB R2012b, Microsoft Windows SDK v.7.1.

 Respuesta aceptada

Fred Smith
Fred Smith el 26 de Dic. de 2012

0 votos

You can find the target build log in the compilation report. When the build fails you should see a link to a report. Open the report by clicking the link. In the bottom right corner you will see a tab for "Target Build Log". Click on the tab, and scroll down. This will show you the errors issued by the C compiler and linker.
There is something wrong with the setup of one of these.
Hope that helps,
Fred
ps. mbuild is not relevant for MATLAB Coder. It won't do anything useful.

Más respuestas (4)

Azzi Abdelmalek
Azzi Abdelmalek el 24 de Dic. de 2012

0 votos

Try
mbuild -setup

5 comentarios

Yuriy
Yuriy el 24 de Dic. de 2012
Thanks for answer.
Don't work. Error is the same.
Azzi Abdelmalek
Azzi Abdelmalek el 24 de Dic. de 2012
are you using deploytool?
Yuriy
Yuriy el 24 de Dic. de 2012
Yes.
Azzi Abdelmalek
Azzi Abdelmalek el 24 de Dic. de 2012
Maybe the problem is related to your code, try to compile a simple code, for example
w=5
while w>0
w=inputdlg('entrer pulsation')
w= str2num(w{:})
t=0:0.1:10
plot(t,cos(w*t))
end
Yuriy
Yuriy el 25 de Dic. de 2012
Editada: Yuriy el 25 de Dic. de 2012
I have tried very simple code:
function f = simple(x)
f=x;
end
But error is the same: Error in ==> Test Line: 1 Column: 1 Code generation failed: Open error report.

Iniciar sesión para comentar.

Rick Rosson
Rick Rosson el 24 de Dic. de 2012

0 votos

Try using Microsoft Visual C++ instead.

1 comentario

Yuriy
Yuriy el 25 de Dic. de 2012
Editada: Yuriy el 25 de Dic. de 2012
Thank`s for answer.
How should i do this?

Iniciar sesión para comentar.

Image Analyst
Image Analyst el 24 de Dic. de 2012

0 votos

See where it says "See the target build log in the report for further details." What is in that file? Report it back here.

5 comentarios

Yuriy
Yuriy el 25 de Dic. de 2012
>> coder -build Untitled1.prj It's target build log: ??? Build error: Build failed for project 'residual_rtw'. See the target build log in the report for further details.
Error in ==> residual Line: 1 Column: 1 Code generation failed: Open error report.
Image Analyst
Image Analyst el 25 de Dic. de 2012
I don't have the coder or rtw toolboxes. Can you compile with the "verbose" option turned on. Maybe with the extra information that "verbose" provides, someone will be able to help you. Otherwise call the Mathworks
Yuriy
Yuriy el 25 de Dic. de 2012
Build log with "verbose" feature:
>> coder -build Untitled1.prj
. ### Processing Template Makefile: C:\Program Files\MATLAB\R2012b\toolbox\coder\coder\rtw\c\xrt\xrt_vcx64.tmf
### Test_rtw.mk which is generated from C:\Program Files\MATLAB\R2012b\toolbox\coder\coder\rtw\c\xrt\xrt_vcx64.tmf is up to date
### Building Test_rtw: .\Test_rtw.bat ќв  Їа®Ја ¬¬  § Ў«®ЄЁа®ў ­  ЈагЇЇ®ў®© Ї®«ЁвЁЄ®©. ‡  ¤®Ї®«­ЁвҐ«м­л¬Ё ᢥ¤Ґ­Ёп¬Ё ®Ўа й ©вҐбм Є бЁб⥬­®¬г  ¤¬Ё­Ёбва в®аг.
??? Build error: Build failed for project 'Test_rtw'. See the target build log in the report for further details.
Error in ==> Test Line: 1 Column: 1
Code generation failed: Open error report.
Image Analyst
Image Analyst el 25 de Dic. de 2012
Wow - what's all that gibberish?
Yuriy
Yuriy el 25 de Dic. de 2012
I don't know, but if I open the Test_rtw.bat in notepad it's ok:
call setup_mssdk71.bat
cd . nmake -f Test_rtw.mk GENERATE_REPORT=1 ADD_MDL_NAME_TO_GLOBALS=0 @if errorlevel 1 goto error_exit exit /B 0
:error_exit echo The make command returned an error of %errorlevel% An_error_occurred_during_the_call_to_make

Iniciar sesión para comentar.

Yuriy
Yuriy el 25 de Dic. de 2012

0 votos

Thanks all for answers. I think I find the problem. When I restart matlab for the purpose of working with MatLab with administrative rights problem is disappeared.

1 comentario

Image Analyst
Image Analyst el 25 de Dic. de 2012
I don't need to do that. When Windows needs such permission, it asks me, but for compilation it never asks for that.

Iniciar sesión para comentar.

Productos

Etiquetas

Preguntada:

el 24 de Dic. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by