필터 지우기
필터 지우기

MEX compilation failed with message: C compiler produced errors. See build log for compiler error:

조회 수: 8 (최근 30일)
simple function file i.e performing addition of 2 input variables. this function file is converted to c code using matlab coder. further, for sil testing i have followed the steps as in the document i.e link : https://in.mathworks.com/help/ecoder/ug/software-in-the-loop-sil-execution-using-the-project-interface.html. but i am getting the error as mentioned above and in the build log it is coming like...
ninja: error: '/lib/addOne/interface/_coder_addOne_info.c', needed by '_coder_addOne_info.o', missing and no known rule to make it
??? MEX compilation failed with message: C compiler produced errors.
See build log for compiler error:
Code generation failed: View Error Report
plz help me
  댓글 수: 5
Jeevan Kulal
Jeevan Kulal 2022년 2월 16일
Yes,I have a compiler selected using "mex -setup C" i.e MInGW-w64.
What is the command line you are using?- Can I get more details on this because I am not using any command line.
Jan
Jan 2022년 2월 16일
The most important information is still missing: "See buildlog for compiler errors". You will find the details there.

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

답변 (1개)

Akshat Dalal
Akshat Dalal 2024년 7월 1일 5:38
Hi Jeevan,
This issue might be happening because the mex compiler is unable to find the CPP file for your function.This might happen as the CPP is a handwritten file instead of a auto-generated file.
This issue can be resolved if you could provide the missing file "_coder_addOne_info.c" to your path using the below command
srcFile = coder.const(fullfile(path, '_coder_addOne_info.c'));

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by