I want to connect to a mysql database with C++ in linux. On my local machine I am running Ubuntu, and installed the mysql server and client packages:
sud
You need to install the header (dev) files, I assume one of these:
apt-cache search mysql
...
libmysqlclient-dev - MySQL database development files
libmysqlclient16 - MySQL database client library
libmysql++-dev - MySQL C++ library bindings (development)
libmysqlcppconn-dev - MySQL Connector for C++ (development files)
...
--with-mysql-lib
should not be necessary because the files will be installed in the default locations.