Recently in the study mysql++ operation MySQL database. With vs2013, originally thought is very simple, but really use up really all kinds of pits, all kinds of compile connection error, make the even burn.
After an afternoon, I finally got through the compilation. This blog summarizes the various issues of attention, so that the use of mysql++ new students after less detours.
First, download mysql++; This is not much to say. After the download is complete there are various files, we need to be Lib folder files.
B. Copy the Lib folder into the project directory and add all the files to the project.
Third, (note) Start adding header files at common.h #include <WinSock2.h> #include <windows.h> note the order of additions, if you first add window.h, a redefinition error will occur.
Four, modify the common.h of about 105 lines of the class capacity is not compiled but #define Mysqlpp_export __declspec (dllimport) revision changed to
#define Mysqlpp_export __declspec (dllexport)
V. Modify the project properties: Add the MySQL include and Lib folders. My C:\Program files\mysql\mysql server 5.6\include and C:\Program files\mysql\mysql server 5.6\lib
Vi. Modification of Project properties: Connection-Add dependencies: Libmysql.lib and Ws2_32.lib
Vii. if MySQL is 64-bit, change the project to x64.
Well, so far, your mysql++ should be able to compile ....
mysql++ VS2013 Environment Configuration