Why do I get an error similar to "undefined reference to <filename> file" when compiling MATLAB generated code with GCC?

7 Ansichten (letzte 30 Tage)
I am using MATLAB Coder to generate C code. I want to compile this code externally, specifically using GCC and compiling the generated main.c file. but I get errors similar to "undefined reference to <filename> file".
What is the cause and how do I fix this?

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 9 Sep. 2019
This error arises because the GCC compilation command is incomplete. You need to specify all the C files that are used in the application at the command line when using GCC.
This will resolve issues with undefined references.

Weitere Antworten (0)

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by