MySQL Forums
Forum List  »  Connector/C++

Re: My fix on get_driver_instance()
Posted by: Vincent Fang
Date: December 30, 2011 10:25PM

Just to confirm what versions you were using,

so Windows 7 64 bit OS
MySQL Connector 1.1.0 32-bit
Visual Studio 2010 C++ express?
MySQL Server Community Edition 5.5?

My setup is
Windows 64-bit OS
MySQL Connector 1.1.0 64-bit
Visual Studio 2010 C++ Express
MySQL Server Community Edition 5.5 64-bit

I tried following your steps and the first initial problem was that there was a int8_t redefinition conflict occurring between the mysql-connector-c++-noinstall-1.1.0-winx64\include\cppconn\config.h and C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h

I redefined the config.h line 60 to be

//typedef __int8 int8_t;
typedef signed char int8_t;

and then when I continue compiling the next error I get is

Error 4 error LNK2001: unresolved external symbol __imp__get_driver_instance C:\mlponline\mlpservercode\MLPOnline_Server\MySQLInterface.obj
Error 5 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::SQLString(char const * const)" (__imp_??0SQLString@sql@@QAE@QBD@Z) C:\mlponline\mlpservercode\MLPOnline_Server\MySQLInterface.obj
Error 6 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::~SQLString(void)" (__imp_??1SQLString@sql@@QAE@XZ) C:\mlponline\mlpservercode\MLPOnline_Server\MySQLInterface.obj

You never came across these errors?

UPDATE:

Found out what was wrong. Because Visual Studio 2010 C++ Express is the free version, it only allows you to compile in 32 bit mode. You need to buy the full version to get the 64 bit version. Since I was using the 64-bit version of the connector, visual studio could never find those functions. So using Express version means you should use the 32-bit version of the connector or mysql server if you decide to create your own connection code.



Edited 2 time(s). Last edit at 12/30/2011 10:48PM by Vincent Fang.

Options: ReplyQuote


Subject
Views
Written By
Posted
9833
October 30, 2011 04:03PM
2794
November 02, 2011 03:07PM
Re: My fix on get_driver_instance()
7932
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.