VS2008 compiler boost::p Ython Boost::serialization Method __python

Source: Internet
Author: User
Tags serialization

First, the preparatory work:

1. Download Boost

2. Decompression Boost

3. Go to boost catalog, run Bootstrap.bat

Second, boost::serialization compilation:

1. Start Menu run: Visual Studio 2008 Command prompt, go to boost directory, run the following command:

B2  --toolset=msvc-9.0--with-serialization--build-type=complete--prefix=c:\boost Install

Third, boost::p Ython compilation:

1. Download the Python installation version, save the trouble of compiling (optional, if you do not install Python, then Python-related libraries will not be compiled)

2. Modify the \tools\build\v2\user-config.jam file under the Boost directory

#---------------------# python configuration.#---------------------
# Configure specific python version.
Using Python:3.3:d:\\python33:d:\\python33\\include:d:\\python33\\libs;
Note: 3.3 Fill in the Python version number you installed here

3. Start Menu run: Visual Studio 2008 Command prompt, go to boost directory, run the following command:

B2  --toolset=msvc-9.0--with-python--build-type=complete--prefix=c:\boost Install


Iv. remarks

Compile parameter description:

1.toolset: The compiler tool, I installed is VS2010, so is msvc-10 (if you are VS2005, you can use msvc-8.0 VS2008 is msvc-9.0)

2.architecture: The architecture, which is your CPU architecture, x86,x64, because I installed the Win7 32 bit, so I used the x86 architecture

3.instruction-set: Indicates instruction set, still 8086 instruction set

4.address-model: Indicates an address length of 32 bits

5.link: Generate dynamic/static link library, dynamic link library is shared, static link library is still, generally will be compiled into a static library, because the program when the package boost library will be very large

6.variant: The generated debug or release version, which will normally be compiled in both versions

7.threading: Single/multi-threaded compilation, generally our program will use multiple threads, so we chose the multi

8.runtime-link: Represents the dynamic/static link C + + Run-time Library (c + + runtime), we have selected dynamic link

9.without/with: means that you do not need to compile/need to compile which libraries, some of their own libraries can not be compiled

10.stage/install:stage represents only generating library files (DLLs and Lib), install also generates include directories containing header files, and recommends the use of stage because the full header file of the Boost library is in Boost_1_49\boost , so there's no need to copy it again. The compiled library is placed in the stage folder

Such a complete boost library is generated, and the rest is directly used in the project.

In fact, the specific commands are compiled can write their own. If you need to compile all. You just need to use this line of code below

B2–toolset=msvc-10.0–build-type=complete

It's okay.


naming Rule description:

Boost's website, "Geting started on Windows" (http://www.boost.org/doc/libs/1_38_0/more/getting_started/ windows.html) mentions the naming rules for boost libraries, which are summarized below:

Take Libboost_regex-vc71-mt-d-1_34.lib as an example: Lib
Prefix: In addition to Microsoft Windows, the name of each boost library starts with this string. On Windows, only normal static libraries use the LIB prefix, and import libraries and DLLs are not used. Boost_regex
Library name: All boost library name files begin with Boost_. -vc71
Toolset tag: Identifies the toolset and version used to build the library. -mt
Threading Tag: Identity building This library enables multithreaded support. Libraries that do not support multithreading do not have-mt. -D
ABI Tags: encodes details that affect the interaction of libraries and other compiled code. For each attribute, add a letter to the tag:

Key Use this library when:
S Statically linked to C + + standard library and compiler Runtime support library
G Debug versions with standard libraries and run-time support libraries
Y Using Python's special debug build
D Build Debug version of code
P Use the STLport standard library instead of the compiler-supplied default library
N Use STLport "native IOStreams" that has been deprecated
-1_34
Version Tags: full boost release number, underline instead of dot. For example, version 1.31.1 will be marked " -1_31_1".. lib
Extension: Depends on the operating system. On most Unix platforms,. A is a static library,. So is a shared library. On Windows,. dll represents a shared library,. Lib is a static or import library.

The following table is the filename compiled for the Regex library:

filename meaning compile options to use when compiling programs that use this library /td>
libboost_regex-vc90-mt-sgd-1_38.lib Static Library, multithreading, debug version  
Use the static Debug version C Run-time Library (libcmtd.li B and LIBCPMTD.LIB)
/mtd
libboost_regex-vc90-mt-s-1_38.lib Static library, multithreading  
use static version C Run-time Library (LIBCMT.LIB and LIBCPMT.LIB)
/mt
libboost_regex-vc90-mt-gd-1_38.lib Static Library, multithreading, Debug version  
using the Dynamic Debug version C Run-time Library (MSVCRTD.LIB and MSVCPRTD.LIB)
/mdd
libboost_regex-vc90-mt-1_38.lib Static library, multi-threaded  
using dynamic version C Run-time libraries (MSVCRT.LIB and MSVCPRT.LIB)
/MD
boost_regex-vc90-mt-gd-1_38.lib Import library (boost_regex-vc90-mt-gd-1_38.dll), multiple threads, debug version  
boost_regex-vc90-mt-1_38.lib Import library (Boost_regex-vc90-mt-1_38.dll) multithreading  


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.