[c] error: Libtool library used but 'LIBTOOL' is undefined

I am trying to automake the OrientDb C++ library, but getting some errors.

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 path.

https://github.com/tglman/orientdb-c

https://github.com/tglman/orientdb-c/wiki/Install

I have configure.ac and Makefile.am already defined.

I run the following autotools

  • aclocal

  • autoheader

  • automake:

libtool (GNU libtool) 2.4.2

configure.ac

# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([orientdb-c],[0.9])
AC_CONFIG_SRCDIR([src/o_query_internal.h])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE()

# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

LT_INIT

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS([malloc.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h     sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([gethostbyname memset socket strchr strcspn strdup strerror])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Things I already tried:

  • autoreconf

  • aclocal -I /usr/share/libtool

  • aclocal -I .

This question is related to c linux autotools orientdb

The answer is


Fixed it. I needed to run libtoolize in the directory, then re-run:

  • aclocal

  • autoheader


In my case on macOS I solved it with:

brew link libtool

For people using Tiny Core Linux, you also need to install libtool-dev as it has the *.m4 files needed for libtoolize.


For mac it's simple:

brew install libtool

For folks who ended up here and are using CYGWIN, install following packages in cygwin and re-run:

  • cygwin32-libtool
  • libtool
  • libtool-debuginfo

A good answer for me was to install libtool:

sudo apt-get install libtool

Examples related to c

conflicting types for 'outchar' Can't compile C program on a Mac after upgrade to Mojave Program to find largest and second largest number in array Prime numbers between 1 to 100 in C Programming Language In c, in bool, true == 1 and false == 0? How I can print to stderr in C? Visual Studio Code includePath "error: assignment to expression with array type error" when I assign a struct field (C) Compiling an application for use in highly radioactive environments How can you print multiple variables inside a string using printf?

Examples related to linux

grep's at sign caught as whitespace How to prevent Google Colab from disconnecting? "E: Unable to locate package python-pip" on Ubuntu 18.04 How to upgrade Python version to 3.7? Install Qt on Ubuntu Get first line of a shell command's output Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running? Run bash command on jenkins pipeline How to uninstall an older PHP version from centOS7 How to update-alternatives to Python 3 without breaking apt?

Examples related to autotools

Debugging the error "gcc: error: x86_64-linux-gnu-gcc: No such file or directory" error: Libtool library used but 'LIBTOOL' is undefined possibly undefined macro: AC_MSG_ERROR Make install, but not to default directories? CFLAGS vs CPPFLAGS What are Makefile.am and Makefile.in?

Examples related to orientdb

error: Libtool library used but 'LIBTOOL' is undefined