Sign in to follow this  
Jarry

Adding API mysql++ to VC++ 2005 express

Recommended Posts

Hello, I'm sorry I didn't know where to post this, I hope this board is fine. I'm trying to add the mysql library to be able to use it in my code. I'm using Visual C++ 2005 express edition, I downloaded the file from: http://tangentsoft.net/mysql++/ My problem is, I have trouble with installation. The guide is quite not clear, and I have found no tutorials or guides about installing this library. What I did is simply copy the whole file into the directory where my app was, then add the library in VC++ options as include, and finally add: include <mysql++> Unfortunately, I get some missing "mysql_version.h" which isn't in the file I downloaded, well in the lib dir. I wonder also if I need to copy any .DLL from mysql server installation. I hope someone can please help me or link me to a complete guide. I thank you in advance.

Share this post


Link to post
Share on other sites
Your concept of installing libraries is wrong.

1) install library to wherever on your PC
2) modify the C++ project settings to add "Aditional Include Directories" and point it to the header folder of the mysql install area
3) modify the linker project settings to add the path to the "Additional Library Directories" and add the appropriate libraries to the "Additional Dependencies" area

you get to all those property windows by right-clicking on your project (not the solution, but the project) in the solution explorer.

you shouldn't need to ever copy the library into your project folder (though with some libraries you'll sometimes need to copy over a dll)

-me

Share this post


Link to post
Share on other sites
I added my directory into My documents directory.

I did the two steps you told me, but I got the same error:

fatal error C1083: Impossible d'ouvrir le fichier include : 'mysql_version.h' : No such file or directory



Any idea please ? This file isn't in my lib dir, but it's not in the .zip I downloaded twice from the main website :(

Share this post


Link to post
Share on other sites
did you search the library install folder to see if you have that file? Is the compile error in your code or theirs?

-me

Share this post


Link to post
Share on other sites
Finally i could correct it !

mysql++ needs the C API to be correctly installed, and it wasn't, but I tought it was. A stupid problem, but annyoing. Now everything is fine. Thanks :)

Share this post


Link to post
Share on other sites

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

Sign in to follow this