I tried to find a good answer online, but could not get it, I completely understood. Suppose I have the header "add.h":
inline int add(int a, int b){ return a+b; }
File named "adddouble.c":
File named "addedquare.c":
Main file "main.c":
#include<stdio.h> int adddouble(int, int); int addsquare(int, int); int main(){ printf("add double = %d\n", adddouble(10,20)); printf("add square = %d\n", addsquare(10,20)); return 0; }
I use gcc5.2.0 to compile these files, but got: "Undefined characters for x86_64 architecture:". If I add static to the built-in function in add.h or add the declaration "extern int add (int, int);" to "adddouble.c", it compiles successfully without errors. I am new to the built-in function, I do not know how to explain and understand this behavior. thanks
source share