Skip to content

Libtool

Libtool(립툴)은 GNU 빌드 시스템에서 나온 GNU 프로그래밍 도구이며 컴파일된 포터블 라이브러리를 만드는 데 이용한다. 라이브러리 도구(Library tool)의 준말이다. Libtool은 일반적으로 Autoconf 및 Automake와 함께 쓰이며 이 두 개의 도구도 GNU 빌드 시스템의 일부로 되어 있다.

Merge archive

여러 개의 정적 아카이브 파일을 병합하고싶을 경우 아래와 같이 진행하면 된다.

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

또는, ar을 사용하는 방법도 있다.

See also

Troubleshooting

libtoolize command not found

Mac OSX에서 brew를 사용하여 libtool을 설치한 후 libtoolize명령을 찾을 수 없을 경우 glibtoolize를 사용하면 된다.

Libtool library used but LIBTOOL is undefined

LIBTOOL이 정의되지 않았다는 에러가 발생할 수 있다.

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

단순하게, 설치여부를 확인해보자. Ubuntu에서 아래와 같이 설치하면 된다.

$ sudo apt-get install libtool

autoreconf를 재실행 한다.

$ autoreconf --install

매크로 파일 경로에 문제가있다면 아래와 같이 확인한다.

$ aclocal --print-ac-dir

Favorite site