Documentation Home
MySQL Connector/C++ Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 249.2Kb
PDF (A4) - 252.8Kb
HTML Download (TGZ) - 52.5Kb
HTML Download (Zip) - 66.8Kb


MySQL Connector/C++ Developer Guide  /  Installing Connector/C++ from Source  /  Installing Connector/C++ from Source on Windows

4.4 Installing Connector/C++ from Source on Windows

To install Connector/C++ from source, verify that your system satisfies the requirements outlined in Section 4.1, “Source Installation System Prerequisites”.

Note

On Windows, mysql_config is not present, so CMake attempts to retrieve the location of MySQL from the environment variable $ENV{MYSQL_DIR}. If MYSQL_DIR is not set, CMake checks for MySQL in the following locations: $ENV{ProgramFiles}/MySQL/*/include and $ENV{SystemDrive}/MySQL/*/include.

Consult the CMake manual or check cmake --help to find out which build systems are supported by your CMake version:

cmake --help

It is likely that your version of CMake supports more compilers, known by CMake as generators, than can actually be used to build Connector/C++. We have built Connector/C++ using the following generators:

  • Microsoft Visual Studio 2013

  • NMake

CMake makes it easy for you to try other compilers. However, you may experience compilation warnings or errors, or linking issues not detected by Visual Studio.

Use these steps to build Connector/C++:

  1. Change location to the top-level directory of your Connector/C++ source distribution, then run CMake to generate build files for your generator.

    For Visual Studio:

    cmake -G "Visual Studio 12 2013"

    For NMake:

    cmake -G "NMake Makefiles"

    To use configuration values different from the defaults, use the options described at Section 4.6, “Connector/C++ Source-Configuration Options”.

  2. Use your compiler to build Connector/C++.

    For Visual Studio:

    Open the newly generated project files in the Visual Studio GUI or use a Visual Studio command line to build the driver. The project files contain a variety of different configurations, debug and nondebug versions among them.

    For example, to use the command line, execute commands like these to build the distribution and create a Zip package:

    devenv MYSQLCPPCONN.sln /build RelWithDebInfo
    cpack -G ZIP --config CPackConfig.cmake -C RelWithDebInfo

    For NMake:

    nmake

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.