Hi... I converted a basic adding program from matlab .m function file into .c & .h file. When i try to include the header file function "add" into my main function in dev-c++ 4.9.9.2 --- [Linker error] undefined reference to `add' is the error message on compilation.
Here is my code
Main function code:
#include "add.h"
#include <conio.h>
main()
{
real_T x,y,z;
printf("Enter two numbers to add\n");
scanf("%lf%lf",&x,&z);
y = add(x,z);
printf("Sum of entered numbers = %lf\n",y);
getch();
//return 0;
}
add.h Header file code
#ifndef __ADD_H__
#define __ADD_H__
/* Include files */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "rtwtypes.h"
#include "add_types.h"
/* Type Definitions */
/* Named Constants */
/* Variable Declarations */
/* Variable Definitions */
/* Function Declarations */
//extern real_T add(real_T x, real_T z);
real_T add(real_T x, real_T z);
#endif
/* End of code generation (add.h) */
FYI : rtwtypes.h has got all the data type defined using typedef....! for double its **real_T **....!
Thanks for your time and valuable suggestions!