One year later.. heinrich5991, maybe you append your tutorial with optional mysql compiling part, because in Linux it's pretty easy and working without problem, but i try help my friend build it on windows and failed in this. First, in visual studio i find just one way to set flags -> CMakeSettings.json file. Second, that's can't automatically find mysql paths. But ok, i try make smth like:
Code: Select all
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x64_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "
-DMYSQL_CONFIG:STRING=\"C:/Program Files/MySQL/MySQL Server 8.0/bin\"
-DMYSQL_INCLUDEDIR:STRING=\"C:/Program Files/MySQL/MySQL Server 8.0/include\"
-DMYSQL_CPPCONN_INCLUDEDIR:STRING=\"C:/Program Files/MySQL/Connector C++ 8.0/include/jdbc\"
-DMYSQL_CPPCONN_LIBRARY:STRING=\"
C:/Program Files/MySQL/Connector C++ 8.0/lib64/vs14/mysqlcppconn-static.lib;
C:/Program Files/MySQL/Connector C++ 8.0/lib64/vs14/mysqlcppconn.lib;
C:/Program Files/MySQL/Connector C++ 8.0/lib64/vs14/mysqlcppconn8-static.lib;
C:/Program Files/MySQL/Connector C++ 8.0/lib64/vs14/mysqlcppconn8.lib;
C:/Program Files/MySQL/Connector C++ 8.0/lib64/vs14/libeay32.lib;
C:/Program Files/MySQL/Connector C++ 8.0/lib64/vs14/ssleay32.lib;
\"
-DMYSQL_LIBRARY:STRING=\"
C:/Program Files/MySQL/MySQL Server 8.0/lib/libmysql.lib;
C:/Program Files/MySQL/MySQL Server 8.0/lib/mysqlclient.lib;
\"
-DMYSQL=ON",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}
]
}
(all "cmakeCommandArgs" represents one line, but I reformat it here for a readable view)
That's compiling but failed on startup on trying get function from mysqlcppconn-7-vs14.dll
(p.s. I place all libs in build folder, but doesn't help).
(p.s.s adding dll libs path in flag leads to a fail on cmake update)
Is there any maybe more elegant and working method for compiling with the mysql on windows?