0

I want install mdbtools from source

and I get the following error

fatal error: sql.h: No such file or directory

so I read the following solutions, but I don't really understand them

https://forums.freebsd.org/threads/46299/ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189382

I did the following:

$ sudo apt install libtool automake autoconf glib2.0 byacc unixodbc
$ cd ~/Downloads && git clone https://github.com/brianb/mdbtools
$ autoreconf -i -f
$ export DOCBOOK_DSL=/usr/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl
$ ./configure --with-unixodbc=/usr/local
$ make
$ make install

This is the full output from the make install command

Thanks for the help

--->> sudo make install
Making install in src
make[1]: Entering directory '/home/fabrizio/Downloads/mdbtools/src'
Making install in libmdb
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
make[3]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ../../libtool   --mode=install /usr/bin/install -c   libmdb.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libmdb.so.2.0.1 /usr/local/lib/libmdb.so.2.0.1
libtool: install: (cd /usr/local/lib && { ln -s -f libmdb.so.2.0.1 libmdb.so.2 || { rm -f libmdb.so.2 && ln -s libmdb.so.2.0.1 libmdb.so.2; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libmdb.so.2.0.1 libmdb.so || { rm -f libmdb.so && ln -s libmdb.so.2.0.1 libmdb.so; }; })
libtool: install: /usr/bin/install -c .libs/libmdb.lai /usr/local/lib/libmdb.la
libtool: install: /usr/bin/install -c .libs/libmdb.a /usr/local/lib/libmdb.a
libtool: install: chmod 644 /usr/local/lib/libmdb.a
libtool: install: ranlib /usr/local/lib/libmdb.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/libmdb'
Making install in extras
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/extras'
make[3]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/extras'
 /bin/mkdir -p '/usr/local/bin'
  /bin/bash ../../libtool   --mode=install /usr/bin/install -c mdb-hexdump '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/mdb-hexdump /usr/local/bin/mdb-hexdump
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/extras'
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/extras'
Making install in sql
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make  install-am
make[3]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make[4]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/sql'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ../../libtool   --mode=install /usr/bin/install -c   libmdbsql.la '/usr/local/lib'
libtool: warning: relinking 'libmdbsql.la'
libtool: install: (cd /home/fabrizio/Downloads/mdbtools/src/sql; /bin/bash "/home/fabrizio/Downloads/mdbtools/libtool"  --silent --tag CC --mode=relink gcc -I../../include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g -O2 -DSQL -Wall -version-info 2:0:0 -export-symbols-regex "^mdb_sql_" -Wl,--as-needed -o libmdbsql.la -rpath /usr/local/lib mdbsql.lo parser.lo lexer.lo ../libmdb/libmdb.la -lglib-2.0 )
libtool: install: /usr/bin/install -c .libs/libmdbsql.so.2.0.0T /usr/local/lib/libmdbsql.so.2.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libmdbsql.so.2.0.0 libmdbsql.so.2 || { rm -f libmdbsql.so.2 && ln -s libmdbsql.so.2.0.0 libmdbsql.so.2; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libmdbsql.so.2.0.0 libmdbsql.so || { rm -f libmdbsql.so && ln -s libmdbsql.so.2.0.0 libmdbsql.so; }; })
libtool: install: /usr/bin/install -c .libs/libmdbsql.lai /usr/local/lib/libmdbsql.la
libtool: install: /usr/bin/install -c .libs/libmdbsql.a /usr/local/lib/libmdbsql.a
libtool: install: chmod 644 /usr/local/lib/libmdbsql.a
libtool: install: ranlib /usr/local/lib/libmdbsql.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make[3]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/sql'
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/sql'
Making install in odbc
make[2]: Entering directory '/home/fabrizio/Downloads/mdbtools/src/odbc'
  CC       odbc.lo
odbc.c:24:17: fatal error: sql.h: No such file or directory
compilation terminated.
Makefile:494: recipe for target 'odbc.lo' failed
make[2]: *** [odbc.lo] Error 1
make[2]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src/odbc'
Makefile:375: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/fabrizio/Downloads/mdbtools/src'
Makefile:474: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
4

Seeing how you're on Ubuntu, most likely you need unixodbc-dev : sudo apt-get install unixodbc-dev . Usually on Debian-based systems when you are asked for a header file (.h or .hpp) you need the corresponding -dev package.

  • it got me to the next error, but I ended up running sudo apt install mdbtools thanks – Fabrizio Bertoglio Nov 17 '17 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.