Embedded coder 'Generate code only' not including toolbox files

8 ビュー (過去 30 日間)
Sam Kysar
Sam Kysar 2022 年 7 月 13 日
コメント済み: Benjamin Thompson 2022 年 7 月 14 日
I am using the CAN Pack/Unpack blocks from the Embedded Coder toolbox. In my model, I generate C++ using ert.tlc and custom settings.
With 'Generate code only' checked, I generate code but the can_message.h is not in my build directory. The Makefile references the file on the system.
Setting PakNGo the can_message.h file is saved in the .zip file but this doesn't work for me. I don't know how to get can_message.h included with my normal build files in the sharedutils directory.
How do I get system included/required files in my normal build directory, not in the zip folder?
Thanks in advance!
EDIT:
Currently this is what I do in my .m build script with the PakNGo feature enabled. It seems like a setting that should be included somewhere in the configuration.
% Remove the "extracted" files and build from the fully packaged directory
if isfolder('build/CANDecoder')
movefile 'build/CANDecoder/CANDecoder.zip' 'build/CANDecoder.zip'
rmdir('build/CANDecoder','s');
unzip('build/CANDecoder.zip','build/CANDecoder');
fileattrib('build/CANDecoder','+w','','s');
delete('build/CANDecoder.zip');
end

回答 (1 件)

Benjamin Thompson
Benjamin Thompson 2022 年 7 月 13 日
If you have some other toolchain to compile the source code, you can locate the file in the MATLAB program files folder and include that folder in your compiler include path. Or you can copy it somewhere else in your file system where you want it to be.
  2 件のコメント
Sam Kysar
Sam Kysar 2022 年 7 月 13 日
I do have another toolchain and was wishing to avoid the manual copy step. Is it possible to do so from the coder configuration settings?
Benjamin Thompson
Benjamin Thompson 2022 年 7 月 14 日
If you use an M file to build your model, you can add copyfile commands to that in order to place the header files from the Program Files MATLAB folder in the place that you want.

サインインしてコメントする。

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by