MySQL C++ with mysql-connector
This post is a tutorial that will explain hot to write a simple C++ code that can be considered the starting point for any other program you intend to write in C++ with the intention to use a MySQL Database.
In order to connect to MySQL from C++ we will use some libraries specifically designed for this purpose.
Despite the concept seems simple, there are a series of gotchas and configurations that can put off the task many people, increasing the amount of work needed and not necessarily forecasted.
This tutorial will reach the goal starting essentially from scratch, where the environment needs to be completely configured… even without Visual Studio!
While writing this tutorial, I decided to split it in multiple sub-posts because of the amount of information I ended up collecting. Doing this will remove some of the noise around the main topic and will allow to follow the post and the specific sections even for people with different requirements that have already available some of the systems I am going to describe.
As a reference, these are the additional posts:
- CMake Installation and usage (Command Prompt Console and GUI)
- Boost Libraries Installation
- MySQL Service, Workspace, Users and Tables
Enough said, let’s start the journey! See you at the end of this. Happy reading.
mysql-connector (1.1.4) – Download
First things first… let’s immediately download what we are really interested in, the C++ libraries (source) that will allow us to connect and interact with a MySQL database.
Open the browser to the MySQL website and navigate to the page with the information about the connector:
http://dev.mysql.com/downloads/connector/cpp/
Select the “Source Code” option from the drop-down menu:
Download the generic Windows version:
In the following page select your preferred download option or just download it using the link at the bottom of the page:
Let’s remember the warning reported on the website:
[stextbox id=”warning” caption=”Warning”]One problem that can occur is when the tools you use to build your application are not compatible with the tools used to build the binary versions of MySQL Connector/C++. Ideally, you need to build your application with the same tools that were used to build the MySQL Connector/C++ binaries.
[/stextbox]
Create a folder, for example “C:\libs\” and extract the archive in there.
The structure should look like this:
In order to build the source code for the connector libraries we need to download CMake.
It’s time to switch to the first sub-post if you need to perform this step and install CMake (CMake Installation and usage (Command Prompt Console and GUI)).
Jump to this post and see you here once you are ready to continue (I would suggest you to follow just the initial part of the tutorial, limited to installing it. The remainder will be useful later on and will probably not work on your system if you don’t have everything else already configured): CMake Installation and usage
Back from CMake Installation
mysql-connector 1.1.4 – Build – First Potential Problem (Missing Visual Studio)
C:\libs\mysql-connector-c++-1.1.4>cmake -G “Visual Studio 10”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:24 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:43 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:26 (PROJECT): No CMAKE_C_COMPILER could be found. CMake Error at CMakeLists.txt:26 (PROJECT): No CMAKE_CXX_COMPILER could be found. -- Configuring incomplete, errors occurred! See also "C:/libs/mysql-connector-c++-1.1.4/CMakeFiles/CMakeOutput.log". See also "C:/libs/mysql-connector-c++-1.1.4/CMakeFiles/CMakeError.log". |
Pay particular attention to the lines:
1 |
No CMAKE_C_COMPILER could be found. |
Visual Studio (C++ 2010 Express)
mysql-connector (1.1.4) – Build – Second Potential Problem (Missing Boost Libraries)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:24 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:43 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is MSVC 16.0.30319.1 -- The CXX compiler identification is MSVC 16.0.30319.1 -- Check for working C compiler using: Visual Studio 10 2010 -- Check for working C compiler using: Visual Studio 10 2010 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler using: Visual Studio 10 2010 -- Check for working CXX compiler using: Visual Studio 10 2010 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Environment compile flags: -- Environment link flags: -- Could NOT find Boost -- Could NOT find Boost CMake Error at CMakeLists.txt:141 (MESSAGE): Boost or some of its libraries found. If not in standard place please set -DBOOST_ROOT:STRING= -- Configuring incomplete, errors occurred! See also "C:/libs/mysql-connector-c++-1.1.4/CMakeFiles/CMakeOutput.log". See also "C:/libs/mysql-connector-c++-1.1.4/CMakeFiles/CMakeError.log". |
The main issue is now:
1 |
-- Could NOT find Boost |
Back from Boost Libraries Installation
mysql-connector (1.1.4) – Build – Third Potential Problem (MySQL not installed)
NOTE:
1 2 |
CMake Error: The current CMakeCache.txt directory C:/libs/mysql-connector-c++-1.1.4/CMakeCache.txt is different than the directory c:/mysqlc++/mysql-connector-c++-1.1.4 where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt CMake Error: The source "C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt" does not match the source "C:/mysqlc++/mysql-connector-c++-1.1.4/CMakeLists.txt" used to generate cache. Re-run cmake with adifferent source directory. |
To quickly fix this, just remove the file “CMakeCache.txt” and run cmake again.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:24 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:43 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is MSVC 16.0.30319.1 -- The CXX compiler identification is MSVC 16.0.30319.1 -- Check for working C compiler using: Visual Studio 10 2010 -- Check for working C compiler using: Visual Studio 10 2010 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler using: Visual Studio 10 2010 -- Check for working CXX compiler using: Visual Studio 10 2010 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Environment compile flags: -- Environment link flags: -- Boost version: 1.56.0 -- BOOST_INCLUDE_DIRS=C:/Boost/include/boost-1_56 -- ENV{MYSQL_DIR} = CMake Error at FindMySQL.cmake:327 (MESSAGE): Cannot find MySQL. Include dir: MYSQL_INCLUDE_DIR-NOTFOUND library dir: cxxflags: Call Stack (most recent call first): CMakeLists.txt:201 (INCLUDE) -- Configuring incomplete, errors occurred! See also "C:/libs/mysql-connector-c++-1.1.4/CMakeFiles/CMakeOutput.log". |
The main indicator for this problem is the line:
1 |
-- ENV{MYSQL_DIR} = |
Back from MySQL installation
mysql-connector (1.1.4) – Build – Creating the Visual Studio Solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:24 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at C:/libs/mysql-connector-c++-1.1.4/CMakeLists.txt:61:43 Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it. -- Environment compile flags: -- Environment link flags: -- Boost version: 1.56.0 -- BOOST_INCLUDE_DIRS=C:/Boost/include/boost-1_56 -- ENV{MYSQL_DIR} = -- MySQL Include dir: C:/Program Files/MySQL/MySQL Connector C 6.1.5/include -- MySQL Library : C:/Program Files/MySQL/MySQL Server 5.6/lib/mysqlclient.lib -- MySQL Library dir: C:/Program Files/MySQL/MySQL Server 5.6/lib -- MySQL CXXFLAGS: -- MySQL Link flags: -- MySQL Include dir: C:/Program Files/MySQL/MySQL Connector C 6.1.5/include -- MySQL Library dir: C:/Program Files/MySQL/MySQL Server 5.6/lib -- MySQL CXXFLAGS: -- MySQL Link flags: -- Installation path is: C:/Program Files/MySQL/ConnectorCPP (overwrite with -DCMAKE_INSTALL_PREFIX=/your/path) -- Looking for include file stdint.h -- Looking for include file stdint.h - found -- Looking for include file inttypes.h -- Looking for include file inttypes.h - not found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of int8_t -- Check size of int8_t - done -- Check size of uint8_t -- Check size of uint8_t - done -- Check size of int16_t -- Check size of int16_t - done -- Check size of uint16_t -- Check size of uint16_t - done -- Check size of int32_t -- Check size of int32_t - done -- Check size of uint32_t -- Check size of uint32_t - done -- Check size of int64_t -- Check size of int64_t - done -- Check size of uint64_t -- Check size of uint64_t - done -- Check size of __int8 -- Check size of __int8 - done -- Check size of unsigned __int8 -- Check size of unsigned __int8 - done -- Check size of __int16 -- Check size of __int16 - done -- Check size of unsigned __int16 -- Check size of unsigned __int16 - done -- Check size of __int32 -- Check size of __int32 - done -- Check size of unsigned __int32 -- Check size of unsigned __int32 - done -- Check size of __int64 -- Check size of __int64 - done -- Check size of unsigned __int64 -- Check size of unsigned __int64 - done -- Looking for strtold -- Looking for strtold - not found -- Looking for strtol -- Looking for strtol - found -- Looking for strtoll -- Looking for strtoll - not found -- Looking for strtoul -- Looking for strtoul - found -- Looking for strtoull -- Looking for strtoull - not found -- Looking for strtoimax -- Looking for strtoimax - not found -- Looking for strtoumax -- Looking for strtoumax - not found -- BOOST_INCLUDE_DIRS=C:/Boost/include/boost-1_56 -- Using static libmysql binding -- DT_RPATH will not be set -- Configuring driver -- MySQL dynamic load test library: C:/Program Files/MySQL/MySQL Server 5.6/lib/libmysql.dll -- Configuring examples -- Configuring test cases -- Configuring tests framework lib -- Configuring C/J junit tests port -- MySQL dynamic load test library: C:/Program Files/MySQL/MySQL Server 5.6/lib/libmysql.dll -- Configuring unit tests -- Configuring unit tests - examples -- Configuring unit tests - connection -- Configuring unit tests - databasemetadata -- Configuring unit tests - resultsetmetadata -- Configuring unit tests - resultset -- Configuring unit tests - savepoint -- Configuring unit tests - preparedstatement -- Configuring unit tests - parametermetadata -- Configuring unit tests - art_resultset -- Configuring unit tests - statement -- Configuring unit tests - uri -- Configuring performance test - statement -- Configuring bugs test cases - unsorted -- Configuring unit tests - group template_bug -- Configuring done CMake Warning (dev) in driver/CMakeLists.txt: Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link interface. Run "cmake --help-policy CMP0022" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Target "mysqlcppconn" has an INTERFACE_LINK_LIBRARIES property which differs from its LINK_INTERFACE_LIBRARIES properties. INTERFACE_LINK_LIBRARIES: mysqlclient;ws2_32 LINK_INTERFACE_LIBRARIES: This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: C:/libs/mysql-connector-c++-1.1.4 |
MYSQLCPPCONN.sln
Build MySqlCppConn.sln – Debug
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
mysqlclient.lib(net_serv.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(plugin_client.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(client_authentication.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(my_default.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(ssl.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(yassl_int.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(handshake_client.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(my_aes_yassl.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(crypto_wrapper.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(yassl_imp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(handshake.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(cert_wrapper.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(asn.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(my_rnd.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(crypt_genhash_impl.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(my_sha1.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(integer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(handshake.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(common.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(log_client.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(my_aes.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(dsa.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(dh.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(rsa.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj mysqlclient.lib(algebra.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in mysql_art_resultset.obj |
Open the properties for the project “mysqlcppconn“. Right-click on it and select “Properties”:
We can do this using different techniques, but I want to use one (even if it is not my preferred one) just for a change :).
Make sure to be in the configuration “Debug” and go in the section:
Common Properties -> Linker -> Input
Open the “Additional Dependencies” drop-down list and click on “<Edit…>”:
Substitute the entry:
- C:\Program Files\MySQL\MySQL Server 5.6\lib\mysqlclient.lib
- C:\Program Files\MySQL\MySQL Server 5.6\lib\debug\mysqlclient.lib
If you build now you could receive another error:
1 |
LINK : fatal error LNK1181: cannot open input file 'C:/Program' |
Open the project properties for the project “mysqlcppconn-static“
- C:/Program Files/MySQL/MySQL Server 5.6/lib/mysqlclient.lib
- “C:/Program Files/MySQL/MySQL Server 5.6/lib/debug/mysqlclient.lib”
1 |
========== Rebuild All: 34 succeeded, 0 failed, 2 skipped ========== |
Build MySqlCppConn.sln – Release
For the release build the only fix I had to do was only the “Additional Options” section in the Librarian -> Command Line
section for the “mysqlcppconn-static” project (in Release configuration).
Add the quotes to:
- C:/Program Files/MySQL/MySQL Server 5.6/lib/mysqlclient.lib
1 |
========== Build: 4 succeeded, 0 failed, 30 up-to-date, 2 skipped ========== |
Libraries
- mysqlcppconn.dll
- mysqlcppconn.lib
- mysqlcppconn-static.lib
Creating a DB
Coding – Create a new Visual Studio Solution
Coding – Configure the Environment
Edit it adding the lines:
C:\libs\mysql-connector-c++-1.1.4\cppconn
C:\Boost\include\boost-1_56
Edit then the Library Directories property, adding the line:
C:\libs\mysql-connector-c++-1.1.4\driver\$(Configuration)\
Edit then the property in:
Configuration Properties -> Linker -> Input -> Additional Dependencies
adding the line:
mysqlcppconn.lib
One last step you may need to do is copying the “libmysql.dll” and “copy “mysqlcppconn.lib” into your output folder.
Just open the properties to:
Configuration Properties -> Build Events -> Post-Build Event
Then edit “Command Line” and type in this (or the equivalent line that you need in order to copy the missing dll to the output folder):
copy “C:\Program Files\MySQL\MySQL Connector C 6.1.5\lib\libmysql.dll” “$(OutDir)”
copy “C:\libs\mysql-connector-c++-1.1.4\driver\$(Configuration)\mysqlcppconn.dll” “$(OutDir)”
Remember to edit All Configurations:
Coding – Code: Connecting to MySQL
Open the “main.cpp” and let’s put some code.
- The database address (and port)
- The User and Password for your user
- The Database name (that contains the “contacts” table)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
// MySQL Connector/C++ specific headers #include <driver.h> #include <exception.h> #define DBHOST "tcp://127.0.0.1:3307" #define USER "cppuser" #define PASSWORD "cpppassword" #define DATABASE "cpptest" using namespace sql; void main() { Driver *driver; Connection *con; driver = get_driver_instance(); try { // create a database connection con = driver->connect(DBHOST, USER, PASSWORD); } catch(sql::SQLException e) { printf("Error connecting to the DB!\n"); exit(1); } printf("Connection to the DBHOST established!\n"); // clean up con->close(); delete con; } |
If your run this code and you didn’t set-up correctly one of the used parameters, then you will see the error text (without crashing). If that’s the case, check your parameters and verify that you will see the “Connection to the DB established!” string.
Coding – Code: Connecting and using the DB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
// MySQL Connector/C++ specific headers #include <driver.h> #include <connection.h> #include <exception.h> #include <statement.h> #include <resultset.h> #define DBHOST "tcp://127.0.0.1:3307" #define USER "cppuser" #define PASSWORD "cpppassword" #define DATABASE "cpptest" using namespace sql; void main() { Driver *driver; Connection *con; Statement *stmt; ResultSet *res; driver = get_driver_instance(); try { // create a database connection con = driver->connect(DBHOST, USER, PASSWORD); } catch(sql::SQLException e) { printf("Error connecting to the DB!\n"); exit(1); } printf("Connection to the DBHOST established!\n"); // select appropriate database schema con->setSchema(DATABASE); // create a statement object stmt = con->createStatement(); // run a query which returns exactly one result set res = stmt->executeQuery ("SELECT * FROM contacts"); // Print some informations about the table printf("Retrieved %d rows\n", res->rowsCount()); // retrieve the data from the result set and display on stdout while (res->next()) { SQLString name = res->getString("name"); SQLString surname = res->getString("surname"); printf("Row %d: %s %s\n", res->getRow(), name.c_str(), surname.c_str()); } // clean up con->close(); delete con; } |
If you build and run the code, you should be finally happily able to see the rows that we entered in our table using MySQL Workbench!
1 2 3 4 5 6 7 8 9 10 |
Connection to the DBHOST established! Retrieved 8 rows Row 1: Riccardo Tramma Row 2: Leonardo da Vinci Row 3: Galileo Galilei Row 4: Alessandro Volta Row 5: Enrico Fermi Row 6: Guglielmo Marconi Row 7: Antonio Meucci Row 8: Amedeo Avogadro |
That’s all!
If any one has problems with the boost library not being found
http://stackoverflow.com/questions/13309900/building-mysql-connector-c-from-source-cant-find-boost-libraries-error
that was my solution