I got a very weird observation of gcc:
Assume we have a library liblolo.a and we have a test program test_lolo.c which uses a function of liblolo.a called lolo_add2 (doesn't matter the function at all).
I first created an object file out of test_lolo.c:
$ gcc -c -o test_lolo.o test_lolo.c
The weird observation is that linking in this style works:
$ gcc test_lolo.o -L./ -llolo -o static_app
But this line does not work:
$ gcc -L./ -llolo -o static_app test_lolo.o
undefined reference to `lolo_add2'
collect2: error: ld returned 1 exit status
This is soooo weird! Any comment?!