Skip to content
Search

Libtool

lastmod 2020-02-28created 2014-01-129 edits

Libtool is a GNU programming tool from the GNU build system, used to create compiled portable libraries. It is short for Library tool. Libtool is generally used together with Autoconf and Automake, which are also part of the GNU build system.

Merge archive

To merge several static archive files, do the following.

$ libtool -static -o libresult.a liba.a libb.a

Alternatively, you can use ar.

See also

Troubleshooting

libtoolize command not found

If the libtoolize command cannot be found after installing libtool with brew on Mac OSX, use glibtoolize.

Libtool library used but LIBTOOL is undefined

You may get an error saying LIBTOOL is undefined.

Makefile.am:10: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:10:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:10:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:10:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:10:   its definition is in aclocal's search pat

Simply check whether it is installed. On Ubuntu, install it as follows.

$ sudo apt-get install libtool

Rerun autoreconf.

$ autoreconf --install

If there is a problem with the macro file path, check it as follows.

$ aclocal --print-ac-dir

Favorite site

author Zer0 sitemap