How can I work out the cause of code generation errors in simulink when using the "Import Custom Code" feature?

조회 수: 72 (최근 30일)
I am trying to build a model which contains a C-Function block using a simple c library (just one header and source file).
However almost any time i make any changes to the header and source and then to the block i get a very unhelpful error message telling me to simply "Fix the errors in your custom code" .
The full error message is this:
Top model targets built:
Model Action Rebuild Reason
=======================================================================
ICCPD_Model Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 2.98s
Error(s) encountered while building custom code simulation target for model 'ICCPD_Model'. Fix the errors in your custom code or disable 'Import custom code' if your custom code has incompatibilities.
Caused by:
Microsoft (R) Manifest Tool
Copyright (c) Microsoft Corporation.
All rights reserved.
mt : general error c101008d: Failed to write the updated manifest to the resource of file "D:\Dropbox\EV Parts\Laptop Code\C++\IC_CPD\EVP_ICCPD_Comms\Demonstrator\ICCCPD_Firmware\Simulink\slprj\_slcc\mOGuHBhlPeYuKKXBoKvpv\mOGuHBhlPeYuKKXBoKvpv_cclib.dll". The system cannot open the device or file specified.
While i am sure that there is an error somewhere that is causing this, i have no idea how to use this message to find the cause.
I am currently only working with only one C Function block with a very simple function so I at least know which block is causing this error, even though it does not mention the block name. But i plan to make my model a lot more complex and will no doubt have bugs along the way which retrigger this problem. But then it will be even harder to diagnose.
Could someone please explain what this error means, i dont know what the file that cant be opened is or what its relevance to my code is?
Is there a way to perhaps access more detailed build logs for the embedded code generation process?
  댓글 수: 1
Seneda Nassir-Ali
Seneda Nassir-Ali 2021년 3월 5일
For what it's worth if anyone else comes across this problem, I have just found that restarting both Simulink And Matlab (just simulink is not enough) and reopening the model, seems to make this go away. At least for now...

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

답변 (1개)

Puru Kathuria
Puru Kathuria 2021년 3월 8일
Hi,
As far as i can read the error message, it is because of the following reasons:
dll files are mandatory after you have generated the code and if you want to run your code on other platforms like C/C++.
And your error states that they are not able to access the dll files.
It can be because of two reasons:
Either the files are read only or they are generated in some other source folders.
But since you were able to access it after restarting that means that they were generated in the same folder and the permissions to access it changed after restarting MATLAB.

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by