3

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.dylib and libmysqlclient.18.dylib are 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?

h345k34cr
  • 3,310
  • 5
  • 21
  • 28
  • In case this never got resolved, see the following post: http://stackoverflow.com/questions/22280499/mysql-connector-c-os-x-10-9-mavericks-and-xcode-5-0-2 – user3387130 Mar 11 '14 at 20:12

0 Answers0