Azzera filtri
Azzera filtri

Invalid object file error during linking when building model

5 visualizzazioni (ultimi 30 giorni)
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 Commento
David Fink
David Fink il 5 Dic 2017
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.

Accedi per commentare.

Risposte (1)

Arthur Joker
Arthur Joker il 8 Set 2021
Hi, did you fix this error now ? I have the same problem as you.

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by