MySQL Forums
Forum List  »  Connector/C++

error C2259 on Visual C++ Express 2008
Posted by: Ricardo Ferreira
Date: April 22, 2009 08:59AM

Hey all,

This is the first time I'm trying to use MySQL with C++. As I have used a MySQL connector before (.NET) I decided to use this new one, since I read it was completely revamped to use with C++. The problem (or problems) is actually trying to "include" the API itself. I have read all of the tutorials, installed the Connector through the msi installer, linked statically and dynamically, then I s started getting this error: error C2259: 'sql::Connection' : cannot instantiate abstract class

ok so I checked the header files, and noticed that the class was completely abstract! I then discovered the drivers directory, which contained the definitions of the functions for these abstract classes. Ok so I thought I had solved the problem, but then it gave me an error that the symbol "Connection" was ambiguous. After searching the header files again, I noticed it was being double (actually, fourtuple or whatever) defined! I started writing #ifndefs and such untill I thought I solved the problem, but it didn't... It was still ambiguous. I reinstalled everything, now I always get error C2259: 'sql::Connection' : cannot instantiate abstract class...

So, my problem is, everyone seems just to include the mysql_driver.h and mysql_connection.h and it magically works! Could anyone help me?

Options: ReplyQuote

Written By
error C2259 on Visual C++ Express 2008
April 22, 2009 08:59AM

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.