R
rayuthar
Hi,
I am having three files similar to the stucture given below, while i
execute my test.c, it show error /test.c:5: undefined reference to
`myfunction'.
I have included myprogram.h in both the files myprogram.c and test.c.
if i comment out the line myfunction from myfunction.h, then it is
working properly. Is it multiple definition error?
i compile the files as
cc -c myprogram.c -o myprogram
cc -c test.c -o test
cc -o test test.o my
Thanks in Advance!
/******* myprogram.c *******/
#include "myprogram.h"
myfunction()
{
}
/******* myprogram.h *******/
myfunction();
/******** test.c *********/
#include "myprogram.h"
int main()
{
myfunction();
}
I am having three files similar to the stucture given below, while i
execute my test.c, it show error /test.c:5: undefined reference to
`myfunction'.
I have included myprogram.h in both the files myprogram.c and test.c.
if i comment out the line myfunction from myfunction.h, then it is
working properly. Is it multiple definition error?
i compile the files as
cc -c myprogram.c -o myprogram
cc -c test.c -o test
cc -o test test.o my
Thanks in Advance!
/******* myprogram.c *******/
#include "myprogram.h"
myfunction()
{
}
/******* myprogram.h *******/
myfunction();
/******** test.c *********/
#include "myprogram.h"
int main()
{
myfunction();
}