ARTICLE AD BOX
I’m trying to build a C++ backend using Drogon with MySQL support, but Drogon fails to detect MySQL during CMake configuration.
Environment
Fedora (latest)
GCC 15.2.1
CMake (recent)
Drogon 1.9.12
Problem
When running CMake for Drogon:
cmake ..I get:
-- MySql was not found.MySQL installation
I installed MySQL using:
sudo dnf install mysql-community-develThe client library exists:
ls /usr/lib64/mysql/libmysqlclient.soOutput:
/usr/lib64/mysql/libmysqlclient.sopkg-config
MySQL is visible through pkg-config:
pkg-config --libs mysqlclientOutput:
-L/usr/lib64/mysql -lmysqlclientHeaders
Headers are located at:
/usr/include/mysqlHowever, I suspect these may not be the correct MySQL headers.
For example:
grep -R "mysql_real_query_start" /usr/include/mysqlReturns nothing.
What I tried
I attempted several approaches:
Reinstall MySQL dev packages
Remove MariaDB-related packages
Force MySQL paths in CMake
cmake .. \ -DMYSQL_INCLUDE_DIR=/usr/include/mysql \ -DMYSQL_LIBRARIES=/usr/lib64/mysql/libmysqlclient.soResult:
MySql was not found.Use MySQL tarball (custom headers/libs)
cmake .. \ -DCMAKE_INCLUDE_PATH=~/Downloads/mysql/include \ -DCMAKE_LIBRARY_PATH=~/Downloads/mysql/libStill:
MySql was not found.Try disabling MariaDB detection
cmake .. -DUSE_MYSQL=ON -DUSE_MARIADB=OFFResult:
USE_MARIADB not used MySql was not found.Additional observation
At one point Drogon detected MariaDB instead:
-- Ok! We find mariadb!But compilation failed with errors like:
mysql_real_query_start not declared MYSQL_WAIT_READ not declaredQuestion
What is the correct way to make Drogon detect MySQL on Fedora?
Is MariaDB interfering with MySQL detection?
Are Fedora’s MySQL headers incompatible with Drogon?
Is there a known issue with Drogon’s MySQL detection?
Expected result
CMake should detect MySQL and enable MySQL support in Drogon.
