Skip to content

cmake can't find MySQL and ODBC libraries #2316

@thiteixeira

Description

@thiteixeira

Expected behavior

...
-- Found MySQL Include directory: /usr/include/mysql  library directory: /usr/lib/x86_64-linux-gnu
-- MySQL Support Enabled
-- ODBC Support Enabled
...

Actual behavior

cmake -DENABLE_DATA_MYSQL=ON yields

-- Couldn't find MySQL or MariaDB
-- MySQL Support Disabled - no MySQL library
-- Could NOT find ODBC (missing:  ODBC_INCLUDE_DIRECTORIES) 
-- ODBC Support Disabled - no ODBC runtime

Steps to reproduce the problem

(please make this a SSCCE, if applicable and reasonable)

POCO_VERSION=1.8.0
wget http://pocoproject.org/releases/poco-$POCO_VERSION/poco-$POCO_VERSION-all.tar.gz
tar -xvf poco-1.8.0-all.tar.gz
cd poco-1.8.0-all/
cmake -DENABLE_DATA_MYSQL=ON

POCO version

1.8.0

Compiler and version

GNU Make 4.1
Built for x86_64-pc-linux-gnu

Operating system and version

Ubuntu 16.04.4 LTS

Other relevant information

As stated in the docs, The Data/ODBC and Data/MySQL Makefiles will search for the ODBC and MySQL headers and libraries in various places. Nevertheless, the Makefiles may not be able to find the headers and libraries. In this case, please edit the Makefile in Data/ODBC and/or Data/MySQL accordingly., but I don't know where to point the make file to. I ran dpkg -L libiodbc2 to find where the libraries are located.
For instance, here's the output for dpkg -L libiodbc2:

$ dpkg -L libiodbc2 
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libiodbcinst.so.2.1.20
/usr/lib/x86_64-linux-gnu/libiodbc.so.2.1.20
/usr/share
/usr/share/doc
/usr/share/doc/libiodbc2
/usr/share/doc/libiodbc2/IAFA-PACKAGE
/usr/share/doc/libiodbc2/changelog.Debian.gz
/usr/share/doc/libiodbc2/AUTHORS
/usr/share/doc/libiodbc2/README.Debian
/usr/share/doc/libiodbc2/copyright
/usr/share/doc/libiodbc2/README.gz
/usr/share/doc/libiodbc2/examples
/usr/share/doc/libiodbc2/examples/odbc.ini.sample
/usr/share/doc/libiodbc2/examples/odbcinst.ini.sample
/usr/share/doc/libiodbc2/NEWS.gz
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libiodbc2
/usr/lib/x86_64-linux-gnu/libiodbcinst.so.2
/usr/lib/x86_64-linux-gnu/libiodbc.so.2

If I change the cmake/FindMySQL.cmake from find_library(MYSQL_LIB NAMES mysqlclient_r to find_library(MYSQL_LIB NAMES mysqlclient it finds MySQL.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions