Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error: Cannot find MySQL. #8

Open
carina-akaia opened this issue Oct 19, 2024 · 1 comment
Open

Build Error: Cannot find MySQL. #8

carina-akaia opened this issue Oct 19, 2024 · 1 comment

Comments

@carina-akaia
Copy link

carina-akaia commented Oct 19, 2024

Hi, I'm trying to build the program on Ubuntu 24.04 installed on Turing RK1 ( RK3588-based compute module ), but the server part build is crashing due to Cmake being unable to detect MySQL lib for Drogon:

-- jsoncpp verson:1.9.5
-- Found UUID: /usr/lib/aarch64-linux-gnu/libuuid.so
-- pg inc: /usr/include/postgresql/usr/include/postgresql/16/server
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Drogon/FindMySQL.cmake:98 (message):
  Cannot find MySQL.  Include dir: /usr/include/mysql library dir:
Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /usr/lib/aarch64-linux-gnu/cmake/Drogon/DrogonConfig.cmake:62 (find_dependency)
  CMakeLists.txt:28 (find_package)


-- Configuring incomplete, errors occurred!

I have more than all the required packages installed ( for example, apparently it's looking for either MySQL or MariaDB, I installed both ) but still no progress.

P.S. I'm not a C/C++ programmer so I'd greatly appreciate any help, as I only wasted time trying to figure it out myself

@Kracozebr
Copy link

Kracozebr commented Nov 13, 2024

Hi, I have had the same problem and manage to fix it.
First of to build paroli I installed a lot of packages:

sudo apt-get update && sudo apt-get install cmake build-essential drogon libdrogon-dev libjsoncpp-dev uuid-dev zlib1g-dev libpq-dev libsqlite3-dev libmysqlclient-dev libbrotli-dev libhiredis-dev libyaml-cpp-dev libogg-dev

Towards your problem I added few lines in cmakelists.txt before find_package(Drogon REQUIRED):

...
set(MYSQL_INCLUDE_DIR "/usr/include/mysql")
set(MYSQL_LIBRARIES "/usr/lib/aarch64-linux-gnu/libmysqlclient.so")
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}:/usr/lib/aarch64-linux-gnu")

find_package(Drogon REQUIRED)
...

but before check location of mysql:

find /usr/lib -name "libmysqlclient.so"
# my output is:
/usr/lib/aarch64-linux-gnu/libmysqlclient.so

So if your location is different then /usr/lib/aarch64-linux-gnu/ you should write it in cmakelists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants