Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link with a .la library file on linux

I am using an open source library and it builds to a file like libshared.la. Can i statically link with this file using normal gcc commands? I'm more familiar with the dynamic linking of .so file and the static linking of .a files. Not sure about .la though. thanks!

like image 306
glutz Avatar asked Aug 07 '12 16:08

glutz


1 Answers

That is a libtool file. You can use it using libtool:

$ libtool --mode=link gcc -g -O -o test test.o \
                     /usr/local/lib/libhello.la

More about libtool:

  • http://www.gnu.org/software/libtool/manual/html_node/Using-libtool.html
like image 58
Igor Chubin Avatar answered Sep 19 '22 01:09

Igor Chubin