MySQL C ++ 1.1.3 Connector Does Not Contain libmysql.lib

So, from Saturday I'm trying to configure MySQL Connector C ++ on VS2012. I will leave without comment that I had to download 1xx mb Boost libs only to run a simple request from my lol program. However, this does not work.

The problem is that even with the proper configuration (following the MySQL Connector Manual from the official website), it simply cannot work, because the last package I downloaded does not contain the files listed in the manual. Manual states :

Add the lib / opt directory to the Additional Libraries text box. This allows you to find the libmysql.lib library file.

But libmysql.lib and / or libmysql.dll does not exist.

While building, I get an obvious error: error LNK1181: cannot open input file 'libmysql.lib'

How can I configure this to work correctly?

edit: Perhaps someone has configured VS2012 to work with MySQL Connector C ++ recently? Should I install MySQL Connector C before? (I tried, it doesnโ€™t work). I need to install MySQL Server on my comp before (I still want to connect to an external server).

+8
c ++ mysql visual-studio-2012
source share
4 answers

You need to install MySQL Server (with C / C ++ API and libraries), the MySQL client library (libmysql.lib) required for MySQL Connector / C ++ is located in the lib directory and / or lib / opt in the Server installation section. catalog.

+1
source share
  • Should I install MySQL Connector C before?

No, they are not dependent on each other.

  • Do I need to install a MySQL server on my comp before

Yes, you must install the MySQL server on your computer, libmysql.dll is located in the mysql / lib directory.

  • When creating, I get an obvious error: error LNK1181: cannot open the input file 'libmysql.lib'

You can, for example, copy libmysql.dll to c: \ windows, and the linker can find this DLL. (or add mysql / lib to the PATH varuiable).

PS I only do static build, with libmysql.dll, but if you are doing a dynamic assembly with the libmysql.lib file, I think you should do the same.

-one
source share

libmysql. * is part of the official mysql connection API

Here:

http://dev.mysql.com/downloads/mysql/5.0.html

Select version and download mysql-noinstall-XXX package

/ lib / opt / lib / debug contains the necessary lib and dll libraries

Add libmysql.lib to the project properties -> Linker-> Input-> Additional dependencies, such as:

libmysql.lib;% (AdditionalDependencies)

libmysql.dll should be accessible to the application at runtime as a common dll

-one
source share

All Articles