You need version 6 of MSVC to build this library. If you are using VC5 then you may want to look at one of the previous releases of this library
Open up a command prompt, which has the necessary MSVC environment variables defined (for example by using the batch file Vcvars32.bat installed by the Visual Studio installation), and change to the <boost>\libs\regex\build directory.
你需要版本6的msvc去编译这个类库。如果你是使用vc5的拥护,请察看之前发布的版本 library, 打开一个命令行窗口,前提是你的msvc环境变量已经被定义(例如使用Vcvars32.bat安装,Vcvars32.bat这个文件在你的vc安装目录下),然后改变路径到<boost>\libs\regex\build
Select the correct makefile - vc6.mak for "vanilla" Visual C++ 6 or vc6-stlport.mak if you are using STLPort.
选择正确的makefile文件, 例如 你使用的是vc6,请选择vc6.mak,如果是使用STLPort请使用vc6-stlport.mak文件
Invoke the makefile like this:
调用makefile命令如下:
nmake -fvc6.mak
You will now have a collection of lib and dll files in a "vc6" subdirectory, to install these into your development system use:
这样你将会有一个包含有lib和dll文件的vc6子文件夹的集合,安装这些道你的开发环境中:
nmake -fvc6.mak install
The lib files will be copied to your <VC6>\lib directory and the dll files to <VC6>\bin, where <VC6> is the root of your Visual C++ 6 installation.
You can delete all the temporary files created during the build (excluding lib and dll files) using:
lib文件将会被复制到你的 <VC6>\lib目录下,dll文件会被复制到<VC6>\bin目录下,<VC6>是你的Visual C++ 6.0的安装目录
你可以删除在编译时产生的临时文件(多余的lib和dll文件):
nmake -fvc6.mak clean
If you want to build with ICU support, then you need to pass the path to your ICU directory to the makefile, for example with:
如果你想编译能支持ICU,你需要指明ICU路径给makefile,例如:
nmake ICU_PATH=c:\open-source\icu -fvc71.mak install
Finally when you use regex++ it is only necessary for you to add the <boost> root directory to your list of include directories for that project. It is not necessary for you to manually add a .lib file to the project; the headers will automatically select the correct .lib file for your build mode and tell the linker to include it.
最后当你使用regex类库的时候,你只需要给你的项目添加<boost>到你的include目录下,他不需要你手动去添加.lib文件去项目,头文件会自动选择正确的.lib文件给你的编译器,告诉连接器去include它。
Note that if you want to dynamically link to the regex library when using the dynamic C++ runtime, define BOOST_REGEX_DYN_LINK when building your project.
如果你想动态编连regex类库,定义BOOST_REGEX_DYN_LINK当编译你的项目的时候。(应该是在stdafx.h头文件中定义BOOST_REGEX_DYN_LINK,添加如下代码:
#define BOOST_REGEX_DYN_LINK)
If you want to add the source directly to your project then define BOOST_REGEX_NO_LIB to disable automatic library selection.
如果你想直接添加源代码到你的项目中,请定义:BOOST_REGEX_NO_LIB 来禁止自动选择类库。
There are several important caveats to remember when using boost.regex with Microsoft's Compiler:
对于使用Microsoft 产品的编译者,这里有几条重要的警告: