I am trying to use Matlab Coder generated C code on Qt Creator. However, whenever I try to build my project, I get an undefined reference error.
Here are some details about the setup:
- I set the hardware to be Generic, 32 bit x86 compatible in the MATLAB Coder settings. Standard Math library is set to C99(ISO), Code Replacement is None.
- My Qt Creator is on an Ubuntu Virtual Machine. Which means that I generate the C code on Windows, then just copy the files to the VM.
- In Qt Creator, I use the "Add Existing Files..." option to import the .h and .c files MATLAB Coder generated. The .pro is automatically populated with the added files.
- In the main function, I have included (#include) the necessary .h file for the function I want to use.
Here is a snapshot of the setup, if it helps. "ml.h" is one of the MATLAB generated header files. The definition for the things in that header file is in "ml.c".
screenshot
What could be the problem? TIA :)