Jūs esateŽurnalai / Ernestas Kardzys's blog / 64 bit MySQL C++ Connector, 64 bit MySQL Server and 64 bit Windows 7 are not compatable?

64 bit MySQL C++ Connector, 64 bit MySQL Server and 64 bit Windows 7 are not compatable?


ParašėErnestas Kardzys - 2011 Kovo 03

This evening I tried to connect to MySQL server from my C++ application. So, some notes about this task:

  • If I use 64 bit versions of MySQL Server, MySQL/C++ Connector and Windows 7 it fails to load. I got a linker error saying that get_driver_instance() is unresolved function.
  • After some googling I found out that this function works only with dynamically linked library.
  • But it also failed to load.
  • So, as a result I installed 32 bit versions of MySQL and MySQL/C++ Connector.
  • But it also failed to connect to server. The problem was that after calling driver->connect() I got an exception.
  • The solution was to include libmysql.dll, libmysqld.dll and mysqlcppconn.dll into my project. In linker properties I added a path to: "C:\Program Files (x86)\MySQL\MySQL Server 5.5\lib\";"C:\Program Files (x86)\MySQL\MySQL Connector C++ 1.1.0\lib\debug". Libraries used: mysqlcppconn.lib libmysqld.lib.

Well, that's it. Now it works :) But it works on 32 bits, not on 64 bits :/

 

Some useful links:

http://blog.ulf-wendel.de/?p=215

http://dev.mysql.com/doc/refman/5.5/en/connector-cpp-apps-windows-visual-studio.html

http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html

Skelbti naują komentarą

Šio laukelio turinys bus laikomas privatus ir nerodomas viešai.
  • Web puslapiu adresai ir el. pašto adresai automatiškai tampa nuorodomis.
  • Leidžiamos HTML žymės: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Linijos ir paragrafai atskiriami automatiškai
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

Daugiau informacijos apie teksto formatavimą

CAPTCHA
Šis klausimas yra skirtas įsitikinti, jog jūs esate žmogus, ir sustabdyti automatinį šlamšto siuntimą.