I am using CLion to make a C++ program that uses a MySQL database to handle data. I have downloaded the MySQL Connector and Boost and linked it to my cmake file. However, when I tried to build my project, an error appeared saying "undefined reference to `_imp__get_driver_instance'". Someone told me to link the MySQL Connector libraries, but since I am quite new to C++ and to using this connector, I have no idea on how to do this.
At the moment, this is my Cmake file:
cmake_minimum_required(VERSION 3.8)
project(Learn_Cpp)
set(CMAKE_CXX_STANDARD 17)
include_directories("C:/mysql-connector-c++-noinstall-1.1.9-win32/include" "C:/mysql-connector-c++-noinstall-1.1.9-win32/include/cppconn" "C:/boost_1_66_0")
set(SOURCE_FILES "C++ Tutorials/ClassFile.cpp" "C++ Tutorials/ClassFile.h" "C++ Tutorials/Learn.cpp")
add_executable(Learn_Cpp ${SOURCE_FILES})
Does anyone know how do I resolve this issue?