Invalid object file error during linking when building model
5 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have a model which uses a s-function block. I was able to build the s-function successfully using the s-function builder and generate a s_func_Name.mexw64 file, a s_func_Name.tlc file and the associated c files (s_func_Name.c and s_func_Name_wrapper.c).
When the generated s-function is used in a simulink model to generate a sdf file for a dSpace MicroAutoBox, the following error is obtained when building:
LINKING APPLICATION ...
< lnkppc >
(F) #A0357 Invalid object file:
Errors: 1, Warnings: 0
-- call "C:\Program Files\dSPACE RCPHIL 2016-B\Compiler\PPCTools\BIN\lnkppc.exe" -K0 -QmsA0314 -QmsA0407 -QmeA0307 -QmeA0329 -m..\Main_MAB.map -o ..\Main_MAB.ppc -c _tmp_Main_MAB.lk
LINKING FAILED (1)
The s-function used external source files, headers and libraries, which have all been included in a rtwmakecfg.m file. The part of the rtwmakecfg file containing the necessary external libraries and source files is illustrated below:
function makeInfo=rtwmakecfg()
%RTWMAKECFG.m adds include and source directories to rtw make files.
% makeInfo=RTWMAKECFG returns a structured array containing
% following field:
% makeInfo.includePath - cell array containing additional include
% directories. Those directories will be
% expanded into include instructions of Simulink
% Coder generated make files.
%
% makeInfo.sourcePath - cell array containing additional source
% directories. Those directories will be
% expanded into rules of Simulink Coder generated
% make files.
makeInfo.includePath = {'L:\some_folder1', 'L:\some_folder2'};
makeInfo.sourcePath = {'L:\current_folder'};
makeInfo.linkLibsObjs = {fullfile(pwd,'my_ext_lib.lib')};
I am not able to find out as to why the build process says that my library is an invalid object file.
Any help would be greatly appreciated.
1 件のコメント
David Fink
2017 年 12 月 5 日
I'm not sure which object file is invalid - the mexw64 is used when simulating in MATLAB, while another library file is generated from the S-Function and built into the model when doing code generation.
回答 (1 件)
Arthur Joker
2021 年 9 月 8 日
Hi, did you fix this error now ? I have the same problem as you.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!