MATLAB: ‘Undefined reference to’ error in S-function builder

reference errors-functions-function buildersimulink

I have this in the S-function Libraries pane
Library/Object/Source file
convert_ok
Include files and external function declarations
#include <math.h>
#include <stdio.h>
#include <string.h>
I call the function in the Output pane
y[0]=Convert(u[0])
*Note: Convert() is a function inside the convert_ok.c source file. During compilation and building the S-function, it gives me the following error ' undefined reference to _Convert' at the y[0]=Convert(u[0]) line in the wrapper file. What is the problem? How can i make this work?

Best Answer

In the Library/Object/Source file pane, you need to specify the full filename (including the .c extension):
convert_ok.c
You may also need to specify the full path to the .c file if it is not present in the current directory.