gcc/g++链接时对库的顺序要求 -Ldir Add directory dir to the list of directories to be searched for -l. -llibrary -l library Search the library named library when linking. (The second alternative with the library as a separate argument is only for POSIX complian
编译链接过程 代码 #cat main.c #include <stdio.h> int add(int x, int y); int sub(int x, int y); int mul(int x, int y); int div(int x, int y); int main(void) { printf("add:%d\n", add(1,2)); printf("sub:%d\n", sub(10,100)); printf("mul