Import a static C library for matlab simulink

3 ビュー (過去 30 日間)
Marcel Rathjen
Marcel Rathjen 2021 年 6 月 1 日
Hey have some troubles to import a static C-Library into Matlab Simulink.
Im using the MinGW-w64 Compiler (https://de.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html)
and have includes my header files,the directories and the library in Simulink via Model Settings-> Simulation Target.
Header Files:
#include "IsoBaseApi.h"
#include "IsoClientsApi.h"
#include "IsoCommonApi.h"
#include "IsoCommonDef.h"
#include "IsoConf.h"
#include "IsoCoreApi.h"
#include "IsoDef.h"
#include "IsoFscApi.h"
#include "IsoMnApi.h"
#include "IsoMnNiuApi.h"
#include "IsoPgnDef.h"
#include "IsoSccApi.h"
#include "IsoStdTypes.h"
#include "IsoTccApi.h"
#include "IsoVtcApi.h"
Library:
libcci_ecu_driver.a
The C-Caller Block can import and read the function but after Trying to Debug the Model i get the following error-codes.
Error(s) encountered while building custom code simulation target for model 'Smart_Traction_VT_Template'. Fix the errors in your custom code or disable 'Import custom code' if your custom code has incompatibilities.
Caused by:
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoBase.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoBaseDiag.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoBaseDistributor.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoMnAl.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoMnDl.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoMnSpn.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoCommon.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoCore.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoData.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoDrvN.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoMnNm.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoClients.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoClServ.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoClShCtrl.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoWoSe.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoFSC.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoSCCtrl.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoSCLogin.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoSCWork.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoTaskC.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoTcConn.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoTcCtrl.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoTcPd.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoTcPool.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoAux.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoPoObj.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoPool.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoVt.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoVTCmd.c.obj)' is incompatible with i386:x86-64 output
C:/ProgramData/MATLAB/SupportPackages/R2020a/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unknown architecture of input file `c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(UtPoPict.c.obj)' is incompatible with i386:x86-64 output
c:\users\marce\desktop\arbeit_aul\smart_traction_dokumentation\matlab_simulink\work\lib_cci\libcci_ecu_driver.a(IsoBase.c.obj): could not read symbols: Invalid operation
collect2.exe: error: ld returned 1 exit status
I would be thankful for any help.
  1 件のコメント
Janani Janagarajan Kalaivani
Janani Janagarajan Kalaivani 2021 年 6 月 18 日
Hi,
Form your build error logs, I doubt if your static library is compatible for your hardware(OS, hardware architecture). Also, as per the log's suggestion, validate the 'Import Custom code' in Configuration parameters dialog box. More information about 'Import Custom Code' is available in the below link,
I am assuming you get this error during Simulation. If the static library is compatible, try using other compilers like Microsoft Visual Studio. The below link has information about changing the default compiler.
https://www.mathworks.com/help/matlab/matlab_external/changing-default-compiler.html

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeSystem Composer についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by