title: mySQL C++ connector Visual Studio 2017
body: <p>I am pretty new to Visual Studio.. Couldn't find similar topic so starting the new one.
  I'm developig an MFC app and I'd like to use mySQL database engine.
  I believe I have followed instructions from the official site to install the C++ connector:
  <a href="https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-apps-general-considerations.html" rel="nofollow noreferrer">Building Connector/C++ Applications: General Considerations</a> and
  <a href="https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-apps-windows-visual-studio.html" rel="nofollow noreferrer">Building Connector/C++ Applications on Windows with Microsoft Visual Studio</a></p>
  
  <p>i.e:</p>
  
  <ol>
  <li><p>I downloaded c++ connector (together with mySQL database engine)</p></li>
  <li><p>I chose to link dynamically against precompiled (by Oracle) c++ connector
  which means I need : LIB/vs14/mysqlcppconn8.lib (import library), LIB/mysqlcppconn8-1-vs14.dll</p></li>
  <li><p>I selected debug mode in my configuration (according to the official docs I can do it even though the library itself may be compiled in release mode)</p></li>
  <li>I added Additional Include Directories (Compiler->General) - which in my case is: "C:\Program Files\MySQL\Connector C++ 8.0\include" - this is where mysqlx/xdevapi.h resides</li>
  <li>I added Additional Library Directories (Linker->General) - which in my case is: "C:\Program Files\MySQL\Connector C++ 8.0\lib64"</li>
  <li>I added Additional Dependencies (Linker->Input) which in my case is mysqlcppconn8.lib (static import lib for the dll)</li>
  <li>I changed option for Runtime Library (C++ -> Code Generation) from MDd to MT (as suggested in the documentation)</li>
  <li>I extended the PATH env variable by adding the directory where the actual dll library is located (in my case the location of the file is C:\Program Files\MySQL\Connector C++ 8.0\lib64\mysqlcppconn8-1-vs14.dll so the path is C:\Program Files\MySQL\Connector C++ 8.0\lib64)</li>
  <li>In the wizard-generated MFC project I added #include  and I get following error: fatal error C1083: Cannot open include file: 'mysqlx/xdevapi.h': No such file or directory</li>
  </ol>
  
  <p>I'm wondering what is causing this since I have added Include search path in step 4.</p>
  
  <p>The directory structure for the library is as follows:</p>
  
  <pre><code> C:\Program Files\MySQL\Connector C++ 8.0\include\mysqlx\xdevapi.h
  
   C:\Program Files\MySQL\Connector C++ 8.0\lib64\mysqlcppconn8-1-vs14.dll
  
   C:\Program Files\MySQL\Connector C++ 8.0\lib64\vs14\mysqlcppconn8.lib
  </code></pre>
  
  <p>The complier command:</p>
  
  <pre><code> /Yu"stdafx.h" /GS /analyze- /W3 /Zc:wchar_t /I"C:\Program 
   Files\MySQL\Connector C++ 8.0\include\mysqlx" /I"C:\Program 
   Files\MySQL\Connector C++ 8.0\include" /ZI /Gm /Od /sdl 
   /Fd"Debug\vc141.pdb" /Zc:inline /fp:precise /D "WIN32" /D "_WINDOWS" /D 
   "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "_AFXDLL" /errorReport:prompt /WX- 
   /Zc:forScope /RTC1 /Gd /Oy- /MT /Fa"Debug\" /EHsc /nologo /Fo"Debug\" 
   /Fp"Debug\exam-questions.pch" /diagnostics:classic 
  </code></pre>
  
  <p>The linker command:</p>
  
  <pre><code>  /OUT:"C:\Users\Kamilek\source\repos\exam-questions\Debug\exam- 
    questions.exe" /MANIFEST /NXCOMPAT 
    /PDB:"C:\Users\Kamilek\source\repos\exam-questions\Debug\exam- 
    questions.pdb" /DYNAMICBASE "mysqlcppconn8.lib" /DEBUG:FASTLINK 
    /MACHINE:X86 /INCREMENTAL /PGD:"C:\Users\Kamilek\source\repos\exam- 
    questions\Debug\exam-questions.pgd" /SUBSYSTEM:WINDOWS 
    /MANIFESTUAC:"level='asInvoker' uiAccess='false'" 
    /ManifestFile:"Debug\exam-questions.exe.intermediate.manifest" 
    /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Program Files\MySQL\Connector 
    C++ 8.0\lib64\" /TLBID:1 
  </code></pre>