In Windows, the Code: wxWidgets project in blocks accesses MySQL (1)-Configuration

Source: Internet
Author: User
Tags wxwidgets

Recently, code: blocks was used in Windows for wxWidgets program development. You need to access the MySQL database on the server. The remote access to MySQL is involved here. You need to configure mysql. There are many specific configuration methods, so I will not talk about it. The wxWidgets project configuration process is as follows:

1. Right-click Project-> properties, open the project/Project Options dialog box, click the build Option Button in the lower right corner of the project, and add the Link Library in the connector settings Tab

C:/program files/MySQL Server 5.0/lib/opt/libmysql. Lib

2. Add it to the search path

C:/program files/MySQL Server 5.0/include

To compile and link. However, the following error occurs during running:

The dynamic link library is missing in windows, so the functions used in the program cannot be found. Find the libmysql1.dll file in the installation directory of MySQL, copy it to the directory where the project is located, and run the program. Everything is OK!

 

C:/program files/MySQL Server 5.0/is the installation directory of MySQL. Because the database on the server is accessed, libmysql is required for running the program. lib, the relevant header file and libmysql1.dll. You don't need anything else. Therefore, copy the lib and include directories under the MySQL installation directory to the project directory, and then perform the preceding configuration. For example, if the project directory is E:/projects/mysqltest, create a folder named MySQL and copy the related files to the directory.

Copy the Lib file under C:/program files/MySQL Server 5.0/lib/opt/

E:/projects/mysqltest/MySQL/lib directory.

Copy the. h file in C:/program files/MySQL Server 5.0/include

E:/projects/mysqltest/MySQL/include directory.

 

Add it to the Link Library in the connector settings label

E:/projects/mysqltest/MySQL/lib/libmysql. Lib

 

Add to search path

E:/projects/mysqltest/MySQL/include

 

The configuration is complete. Of course, do not forget to copy libmysql1.dll to the current project directory.

In this way, each client does not need to install the MySQL database, which saves space and saves the trouble of installation and greatly facilitates user use.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.