MySQL Forums
Forum List  »  Connector/C++

My fix on get_driver_instance()
Posted by: axel blackert
Date: October 30, 2011 04:03PM

After spending a whole day trying to fix this problem I finally got it to work. After a lot of googling it seems like many people also have the same problem so I thought I would share my experience with this problem.


Error 1 error LNK2001: unresolved external symbol _get_driver_instance

First I downloaded the 64bit version of the latest MSI installer, which didn't work for me no matter what I linked to. I'm going to keep this straight forward so here is the things I made to make it work:

1.) Download this version of the C++ Connector
http://dev.mysql.com/downloads/mirror.php?id=393791

2.) Download boost from boost.org

3.) Extract it and add setup your include directories like this: (C/C++ General)
path\mysql-connector-c++-noinstall-1.1.0-win32\include\cppconn;
path\mysql-connector-c++-noinstall-1.1.0win32\include;
path\boost_1_46_1;

4.) Add the lib folder to your Additional Library Directories (Linker/General)
path\mysql-connector-c++-noinstall-1.1.0-win32\lib

5.) Add these to your Additional Dependencies (Linker/Input)
mysqlcppconn.lib;
libmysql.lib;

6.) Move mysqlcppconn.dll to your project folder

All these are things you can read here : http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-apps-windows-visual-studio.html

I think the main thing that made it work for me was that I downloaded another release instead of the MSI installer.

I'm running Windows 7 with Visual Studio 2010.

I hope this help someone!

Cheers,
simpler

Options: ReplyQuote


Subject
Views
Written By
Posted
My fix on get_driver_instance()
9865
October 30, 2011 04:03PM
2802
November 02, 2011 03:07PM
7956
December 30, 2011 10:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.