Reputation: 11
I have searched like crazy and cant find an answer. I am trying to use mysql in my c++ project and have #include mysql.h but I need that directory file. Does one exist? I got all my code set up but zilions of errors because the file is missing. I'm following a tutorial but they dont explain where to get that directory. Any help would be great. Thanks!!
Upvotes: 0
Views: 7756
Reputation: 3742
I know that that I am too late to post the answer, but just documentation purposes and for those who search for the same error.
Downloading the community server is just enough. Note: choose the zip file. Choose the x32 since the compiler is automatically configured to build with x32 configuration. If you intend to change the compilation configuration to x64, then go ahead and download the x64 zip file.
After download the zip file, create your new blank project. If you are using MSVC++Express2010, Open the project properties | C/C++ | Additional Include Directories. Add the path to the include folder found in the extracted folder.
Copy the library files found in lib folder in the extracted folder to the project directory where you can find your *.cpp files.
Add the following lines to your code:
#include <my_global.h>
#include <mysql.h>
#pragma comment(lib, "libmysql.lib")
Now you are ready to go :)
You can try the code found here to see if things went right or not.
Upvotes: 3