I have a problem using MySQL Connector for C++ in Xcode 5.
When I use the sql::Driver->connect I get EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
What I have:
- 64bit Boost libs (working)
- 64bit Mysqlconnector (dylib) + header files (which are in Xcode)
libmysqlcppconn.7.dylibandlibmysqlclient.18.dylibare copied to the binaries directory for being loaded (if I don't have them there, it tells me it cannot find the images.)- Compiled with 64bit Intel
What I do:
try
{
sql::Driver *driver = get_driver_instance();
driver->connect(DBHOST, DBUSER, DBPASSWORD);
m_databaseConnection = driver->connect(DBHOST, DBUSER, DBPASSWORD);
m_databaseConnection->setAutoCommit(true);
m_databaseConnection->setSchema(DBDATABASE);
return true;
}
catch (...)
{
return false;
}
I've set a breakpoint above driver->connect and recognized that driver is set, so get_driver_instance() seems to work.
When calling its connect method, driver becomes NULL and the program crashes with bad access.
How can I solve this?