Jump to content

? servers

? players online

C++ and MySQL in Visual Studio 2010

Recommended Posts


  • Content Count:  3178
  • Joined:  08/06/08
  • Status:  Offline

Alright, for the programmers here who program C++.

 

I have been searching myself dead trying to get MySQL to work with C++ in Visual Studio 2010.

 

 

What I need is:

- How to set up a MySQL library for C++ inside Visual Studio 2010, so I can connect to MySQL, edit stuff, etc in it.

- An example code of how that API works in C++, this so I know how to work with it (connecting, doing queries etc).

 

 

These are the ones I have been looking into:

- MySQL++ = Seems incomplete, mysqlpp_d.lib is missing from the libraries folder..

- MySQL wrapped = License tells me to only distribute program if it is open source. So I cannot use it closed-source.

- SQLAPI++ = License doesn't allow me to distribute my applications (WHICH IS THE PURPOSE OF A PROGRAM 90% OF THE TIME)

 

 

If any of you know of a better API, OR you can help me get one of the above working in VS2010, then please, help me :p

 

 

Thanks in advance.

Link to comment

  • Content Count:  829
  • Joined:  02/28/09
  • Status:  Offline

MySQL++ = Seems incomplete, mysqlpp_d.lib is missing from the libraries folder..

 

I had a look at the MySQL++ website and you can only download the source code, so you'll have to compile it in VS yourself.

 

If any of you know of a better API

 

The MySQL Devs/Oracle offer a wrapper for the MySQL C API called Connector/C++, it's not as mature as MySQL++ but it's newer and is probably updated more often.

 

dev.mysql.com/downloads/connector/cpp

 

Here is the documentation with some tutorials: dev.mysql.com/doc/refman/5.1/en/connector-cpp.html

 

Here is a guide for setting it up in VS: dev.mysql.com/doc/refman/5.1/en/connector-cpp-apps-windows-visual-studio.html

 

^ Also be sure to read the user comments on that.

Link to comment

Reply to Thread

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...