1

I am new to C++.

I am trying to make a MySQL connection. I found that it requires mysql-connector. I installed boost-dev-all Install boost-dev-all. I have put my mysql-connector in local directory ~/bin. I have successfully installed it.

But when I try to make mysql connection, I get an error:

fatal: cppcon: directory missing

On digging around, I understoodd cppconn folder has been missing from /usr/include. Should I copy cppconn folder to /usr/include?

sudo cp /bin/mysql-connector /usr/include

2 Answers 2

2

I had the same problem but I solved it by executing the following command:

sudo apt-get install libmysqlcppconn7v5 libmysqlcppconn-dev

This installed all required header files in /usr/include/cppconn. After that I was able to compile my program.

1

The problem is likely that you have not installed the libmysqlcppconn-dev Install libmysqlcppconn-dev package, which provides the cppconn directory in /usr/include. You can install this package with:

sudo apt-get install libmysqlcppconn-dev
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .