C + + uses boost Regex library summary

Source: Internet
Author: User

Use Java time feel quite toss, back to get C + + just know what called toss ... Sweat...

First refer to this article I wrote: http://www.cnblogs.com/qrlozte/p/4100892.html

After I downloaded the entire boost zip from SourceForge, I was mostly in the problem of compiling the boost regex: There are a lot of library,regex in boost, but how do you compile the regex?

Of course, the first step is to look at the document, find boost-path/doc/html/index.html Open, turn over half a day owe Regex documentation (can be directly found directly from boost-path/libs/regex/index.html)

Inside the document says:

Building from Source

The Regex library is "just a bunch of source files": Nothing special be required to build them.

You can either build the files under boost-path/libs/regex/src/*.cpp as a library, or add them directly to your P Roject. This is particularly useful if your need to use specific compiler options not supported by the default Boost build.

So find this directory, did find a lot of CPP files, directly open terminal

g++-C *.cpp

So I reported a lot of error to find the file, a look, is similar to <boost/regex/xxx.hpp> and so on can not find, go back to see the document, so, in "Getting Started on Windows" This page found the description, Discover Boost-path/boost is full of header files, this page is described as follows:

This is a sketch of the resulting directory structure:

Boost_1_57_0\.................the "Boost root directory"   index.htm.........A copy of www.boost.org starts here   Boost\.........................All Boost Header files   Lib\.....................Precompiled Library binaries   Libs\............Tests,. cppS, Docs, etc., by library     index.html........Library documentation starts here     algorithm\      any\     Array\                     ... more libraries ...   Status\.........................boost-wide test Suite   Tools\...........Utilities, e.g Boost.build, quickbook, bcp    More\..........................Policy documents, etc.   Doc\...............A subset of all Boost library docs

The Boost-path/boost folder is then copied to the Mingw/include directory, which means: Mingw/include/boost, which becomes part of the compiler's default search path

Open Terminal again:

g++-C *.cpp//compile to. o file ar-r boost_regex.a *.O//package as. A file (library file, Java-like jar package, but to be used with the library's header file)

Well, refer to the steps in this article: http://www.cnblogs.com/qrlozte/p/4100892.html

Done

C + + uses boost Regex library summary

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.