필터 지우기
필터 지우기

Embedded coder for simulink model does not link libraries in the right order

조회 수: 2 (최근 30일)
Didier Billard
Didier Billard 2021년 3월 24일
답변: Didier Billard 2024년 5월 24일
Hello,
I am trying to generate an executable using a simple SImulink project using Embedded Coder for C code.
This model is calling some specific function defined into an external library let us call it libOne.a
When Embedded Coder is about to link the C code generated from my Simulink model, the order of the libraries to use is the following one:
gcc -o someExecutable libOne.a rtwshared.lib
With this wrong order, the link failed because a function called into rtwshared.lib which is defined into libOne.a is not found (which is normal error with this library order)
the right command to link should be the following:
gcc -o rtwshared.lib libOne.a
How can I configure my very very simple Simulink model so that libraires ar linked in the right order and not in the wrong reverse order ?
Thank you in advance for your help.
best regads.

답변 (2개)

Vidhi Agarwal
Vidhi Agarwal 2024년 5월 24일
Hi Didier,
I understand you are facing an issue while linking external libraries in embedded coder.
You can try to go through the documentation of coder.EmbeddedCoderConfig:
In this there’s a function called “CustomLibrary which might help you in linking static library files with the generated code.

Didier Billard
Didier Billard 2024년 5월 24일
hello,
thank you very much for your response, I will try as soon as I can go back to my old project.
I am very happy to see someone has read my question because I did not hope to get any information for this.
As you can see, it took more than 3 years between question and answer which may seem quite long.
Nevertheless I appreciate you answering my question, I didn’t expect it anymore.
Best regards.

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by