Invalid object file error during linking when building model

조회 수: 1 (최근 30일)
Vijaya Bhaskar
Vijaya Bhaskar 2017년 12월 1일
답변: Arthur Joker 2021년 9월 8일
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
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.
I recommend contacting DSpace Support for further assistance regarding this issue.

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

답변 (1개)

Arthur Joker
Arthur Joker 2021년 9월 8일
Hi, did you fix this error now ? I have the same problem as you.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by