'MySql mysql.h file not found in VS2008 C++ <Beginner Question>
I am getting this error when trying to run a simple SQL C++ program (IDE used VS 2008)
fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
this is how my code looks like;
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <mysql.h>
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
I think that my IDE is unable to find the path of the MYSQL Installation or some thing similar. What should i do to resolve this situation. Step by step instructions appreciated.
Solution 1:[1]
1 - make sure you actually have MySQL's header files installed. Typically, these are located in the 'include' directory of your mysql installation.
2 - Set your Visual Studio C++ project settings to include that include directory for use by C++ projects.
Add your mysql include directories to the box.
Tool->Options->Projects and Settings->VC++ Directories. Then on the right hand side, Open the dropbox labeled "Show Directories For" and pick "Include Files". Here's a screen shot of that window.

Additionally, you will probably want to set up Library directories to include MySQL's `'lib' folder as well, so that later on your builds can find the mysql libraries to link against.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
