How to compile boost and install pkg-config in mingw/msys

Source: Internet
Author: User
Tags intl

Compile boost in mingw/msys

First, install mingw. The installation is very convenient. Download mingw-get or its graphic interface on the website, and then install it. However, the download may fail during the installation process. Therefore, it is recommended that you use the mingw-get command line version. If the download fails, you can execute the command again immediately.

First, you must install gcc and g ++, and use mingw-get install gcc g ++. How is this command like debian's package manager ~

After installation, download the msys installation package. A graphical interface is provided to facilitate installation. Select "yes" in the "whether mingw has been installed" option and enter the mingw installation path. This path is written by msys in fstab and mounted to the/mingw directory during runtime.

After opening msys, you can start compiling boost. First, download the source code package and decompress it. After several attempts, you cannot directly execute the bootstrap. sh script at the outermost layer of the boost source code to generate the bjam file. Run the command directly and the system/resources cannot be found. h. If you specify the toolset as mingw, bjam can be compiled. However, if you compile the following boost modules, mingw is missing. jam file.

Therefore, by viewing these script files, you can go to the toolsbuildv2enginesrc directory and execute build. sh mingw to compile the required bjam files. Let's take a look at it. In fact, for mingw, the compilation tool is gcc, but the source code is different when bjam is compiled, so sys/resouces will not appear. h.

After compilation, copy bjam.exe in the bin.ntx85directory to the outermost layer of the source code directory, and then return to the outermost layer for execution:
Bjam-prefix =/mingw-toolset = gcc variant = release link = static threading = multi runtime-link = static install

Because it is used in windows, all databases are statically connected for convenient distribution. Install boost in the/mingw Directory, that is, the place where mingw is installed, so that you can find the library here when compiling other things. At the beginning, a prompt will be displayed. mpi is not used by default, and python cannot be found in the system. These two do not need to be used yet.


Install pkg-config in mingw/msys

During vmime compilation, it is found that the gnutls library cannot be found during configure, which is already installed. After reading the configure file, we found that pkg-config is not installed.

Follow the tips in mingw's faq to download the binary packages of glib and pkg-config. Decompress the glib package and copy libglib. dll to/mingw/bin. then copy pkg-config.exe to/mingw/bin. At the next run time, the prompt pkg-config.exe lacks intl. dll. Read the download page carefully. The dll is downloaded in the binary package of gettext. After intl. dll in/mingw/bin is released, pgk-config can run normally and vmime can be compiled normally.

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.