How can i set Linker flags in an S-Function block

I am using matlab 2024b and Simulink 24.2. In the S-function builder I wish to use wiringPi deployed to a Raspberry Pi. WiringPi is installed on the Raspberry Pi. How can I add the linker flags so the build process will link to libwiringPi.so located in /usr/lib?

Respuestas (1)

Sumukh
Sumukh el 23 de Dic. de 2024
To use the wiringPI library installed on the hardware, the "wiringPI.h" header file can be specifically linked within the s-function during the "Build" process as follows:
  1. Navigate to Configuration Parameters (Ctrl+E) > Code Generation > Build Process > Build Configuration and choose "Specify" from the dropdown list.
  2. Navigate to "Toolchain details" tab and specify the header file in the Linker section as: "-lwiringPI".
  3. Apply the changes.
Now the wiringPI library can be used when installed on the Raspberry PI hardware.
I hope this answers your query.

1 comentario

Jon
Jon el 23 de Dic. de 2024
This solved my problem. I can now specify the wiringPI lib and build. Thank you!

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Coder en Centro de ayuda y File Exchange.

Productos

Versión

R2024b

Preguntada:

Jon
el 22 de Dic. de 2024

Comentada:

Jon
el 23 de Dic. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by