multiple definition error when using MATLAB Coder

6 visualizaciones (últimos 30 días)
YOUNSIL KIM
YOUNSIL KIM el 3 de Jun. de 2025
Respondida: Song-Hyun Ji el 4 de Jun. de 2025
Hello I have problem to use the generated libraries by using Coder.
I make few static libraries by using the Coder. And the same function (inpolygon) is used in the generated libraries.
If I use the all libraries, the multiple definition error occurrs because the same function is included in the libraries.
How can I solve this problem?
Actually, when I use the MATLAB version 2020a, the previous version, there is no problem like this.

Respuestas (1)

Song-Hyun Ji
Song-Hyun Ji el 4 de Jun. de 2025
From the error shown in the screenshot you provided, both libCMAP_sector.a and libCMA_polygon.a include inpolygon.o. Additionally, both libOPGS_sector.a and libCMA_sector.a include minOrMax.o, which results in multiple definition errors during linking. To investigate further, please share a minimal reproducible sample and the exact steps to reproduce the issue.

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by