Compilation don't work. Why?

조회 수: 4 (최근 30일)
Yuriy
Yuriy 2012년 12월 24일
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.

채택된 답변

Fred Smith
Fred Smith 2012년 12월 26일
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.

추가 답변 (4개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 24일
Try
mbuild -setup
  댓글 수: 5
Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 24일
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 2012년 12월 25일
편집: Yuriy 2012년 12월 25일
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.

댓글을 달려면 로그인하십시오.


Rick Rosson
Rick Rosson 2012년 12월 24일
Try using Microsoft Visual C++ instead.
  댓글 수: 1
Yuriy
Yuriy 2012년 12월 25일
편집: Yuriy 2012년 12월 25일
Thank`s for answer.
How should i do this?

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2012년 12월 24일
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
Image Analyst
Image Analyst 2012년 12월 25일
Wow - what's all that gibberish?
Yuriy
Yuriy 2012년 12월 25일
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

댓글을 달려면 로그인하십시오.


Yuriy
Yuriy 2012년 12월 25일
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
Image Analyst
Image Analyst 2012년 12월 25일
I don't need to do that. When Windows needs such permission, it asks me, but for compilation it never asks for that.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Code Verification에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by