Home:ALL Converter>Using Matlab Coder generated C files on Qt Creator

Using Matlab Coder generated C files on Qt Creator

Ask Time:2015-05-05T22:50:14         Author:renzbagaporo

Json Formatter

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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 :)

Author:renzbagaporo,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30056320/using-matlab-coder-generated-c-files-on-qt-creator
yy