I have three files in my XV6: testmain.c, foo.h, and foo.c :
foo.h :
extern void myfunction(void)
foo.c:
#include "foo.h"
void myfunction(void){
printf(1, "HelloWorld"); }
testmain.c:
#include "foo.h"
int main(void){
myfunction();
return 0 ; }
I am getting undefined reference error for myfunction() in test_main . I know I need to change something in Makefile for XV6, but I don't know what. that's what I have changed in XV6 Makefile:
UPROGS=\
_cat\
_echo\
_forktest\
_grep\
_init\
_kill\
_ln\
_ls\
_mkdir\
_rm\
_sh\
_stressfs\
_usertests\
_wc\
_zombie\
_foo\
_testmain\