This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to create Header file for a C function

I created a new project( CHOOSING THE library function) and write the code :

#include<stdio.h>

//signed long int pow(signed int base, signed int power)
signed long int pow(signed int base, signed int power); signed long int pow(signed int base, signed int power)
{ signed long int result_pow = 1;
for(;power>0;power--)
{ result_pow = result_pow * base;
} return(result_pow);
}

this generated a power.lib as library file after building .
Now I created a header file with the code :

#ifndef __power_h
#define __power_h

//signed long int pow(signed int base, signed int power)
signed long int pow(signed int base, signed int power); signed long int pow(signed int base, signed int power)
{ signed long int result_pow = 1;
for(;power>0;power--)
{ result_pow = result_pow * base;
} return(result_pow);
}

#endif

Now I m having the error :
Power.axf: Error: L6218E: Undefined symbol main (referred from rtentry2.o).

=>How to link the new created header file with library file .
=>How do i solve this error and HOW TO CREATE A 'C' HEADER FILE FOR 'C' FUCTIONS .

0