VS 2005 Using Boost regex

Source: Internet
Author: User

The first step:

Introduction to Boost and its VS2005 compilation boost Library Boost.regex Library Installation Guide

Boost download and boost installation
Where do I download boost? English http://www.boost.org, Chinese http://boost.c-view.org, you can find a compressed package in. zip or. tar.gz format. After downloading, extract to a directory, such as BOOST_1_26_0, there are generally a few sub-directories: Boost, LIBS, more, people, status, tools, see no problem on the line.
If you are too lazy to download the entire package when the boost is updated, just want to update the files that have changed, or you are a boost Fans like me and want to keep track of the latest changes in boost, use the CVS approach. First, there must be a CVS client software, such as the Wincvs, Gcvs, and Maccvs provided by Cvsgui or http://sourceforge.net/projects/cvsgui/, respectively, for Windows, Linux and MacOS platforms. Download, install, and start the three-step song.
Compile boost Library under VS2005
1. Start VS2005, and in the tool menu, select Visual Studio 2005 Command Prompt. VS launches the Command Prompt window and automatically sets the appropriate environment variables.
2. Go to the <boost>/libs/regex/build directory (<boost> is the path where you store the boost code), and the process can be compiled by running the following command, which may be a bit longer:
Nmake-f Vc8.mak

3. Run the following command to install, and boost will copy the Lib file generated from the previous step to your VC directory.
nmake-f vc8.mak install

4. Finally, clear the temporary files that are generated during installation:
nmake-f Vc8.mak clean

3. and 4. No success, manually copied to C:\Program Files (x86) \microsoft Visual Studio 8\vc\include Directory

Step Two:

Link encountered issue: fatal error LNK1104: Can't open File "Libboost_regex-vc80-mt-1_57.lib"

The compiled Lib

At first I downloaded the version 57. So I downloaded the 53 version of the zip file, unzip the header file into C:\Program files (x86) \microsoft Visual Studio 8\vc\include directory.

Fatal error LNK1104: Can't open File "Libboost_regex-vc80-mt-gd-1_46_1.lib"

With the Lib prefix, the use of static links is indicated.

To make your program dynamically link to boost, you need to:

#include <boost/regex.hpp>

Previously defined macros:

#define Boost_regex_dyn_link 1

#define Boost_regex_dyn_link 1
#include <boost/regex.h>

VS 2005 Using Boost regex

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.