强制gcc只在一个目录中查找库文件

So I am making a C application and I have all the library files .so , .a etc in a ./lib directory in the same directory as my C application.

I am compiling my C application with the -L./lib flag. But it seems to me that gcc still looks for libraries within /usr/lib /usr/local/lib etc .

Is there a way to force gcc to only look for library files in my ./lib directory? So if I remove the ./lib folder the application won't compile because it can't find the libraries.

评论