oceanbase的库依赖问题

LDADD = libtest2.a \
libtest2.a


gcc –o test main.c libtest2.a libtest1.a


-l library

Search the library named library when linking. (The second alternative with the library as a separate argument is only for POSIX compliance and is not recommended.)

It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded.

ps: 刚刚看到晓楚师兄的博客里也有一篇说这个事情的….w