Compiling newest Boost_1_53_0 with VS2008
来源:互联网 发布:淘宝热销商品 编辑:程序博客网 时间:2024/06/05 06:49
BOOST WITH VISUAL STUDIO 2008
By xiaoxiong
xiongxiang2006@126.com
Pre: Everybody know that the boost library is a greatest C++STL library, It provide many interface in all sorts of library, such as thread,string ,math, allocate, math and so on.
For the needed of thesis, I need to find out a way toachieve the thread pool and the memory pool…. Let’s go through the topic ofconfigure the boost with VS2008.
1. Prepare the package of boost, which can downloadfrom the http://www.boost.org. The latestversion is boost_1_53_0;
2. Unpackaged the file “boost_1_53_0.zip”(or othersame name) to your specific path, such as my own path is “D:\Program Files(x86)\boost_1_53_0”;
3. Run the “Visual Studio 2008 Command Prompt”console window.
And redirect to the boost source file path.For example,Input
D:
cd D:\Program Files(x86)\boost_1_53_0
4. Now, we are in boost file directory, and knowexecute command (run bootstrap.bat),
bootstrap.bat
And the execute
bjam.exe --toolset=msvc-9.0 --build-type=complete stage
NOTE:
a. the *.lib file would put in to the folder“stage”.
b. the command default compile the full library ofboost, you can also specific the library you interest in, and use these command
c. bootstrap.bat --toolset=msvc-9.0 --with-system -with-thread
5. Know you can enjoy yourself with a cup of tea ordo something others, it always take bit long time to compile, it depends onyour personal computer performance.
6. As you have complete the compile , You may seefollows informations,
...failed updating 3 targets...
...skipped 2 targets...
...updated 3146 targets...
It said that you have success build thelibrary, We can continue the steps
7. Open the VS2008, and configure the “Project andSolutions”(use combination key “Alt+t+o “, and choose the “Project andSolutions->VC++ Ditectories”), add choose “WIN32” plateform
.
8. Add “Include files”, insert new line, and pastthe boost source absolute path way, such as “D:\Program Files (x86)\boost_1_53_0”;
Add “Library files”, as bellow, add “D:\ProgramFiles (x86)\boost_1_53_0\stage\lib”;
9. Test for the boost library.
Create a new console project and past thesecode.
// boostUsage.cpp -- after compling theboost library, it's the first time to use boost library.
#include<iostream>
#include<string>
#include"boost/regex.hpp"
using namespace std;
using namespace boost;
int main(int argc, char* argv[])
{
int myend;
int new_counter=0;
int delete_counter=0;
boost::regex reg("(new)|(delete)");
boost::smatch m;
std::string s="Calls to new must be followed by delete.\
Calling simply new results ina leak!";
std::string ::const_iterator it=s.begin();
std::string::const_iterator end=s.end();
while(boost::regex_search(it,end,m,reg))
{
m[1].matched?++new_counter:++delete_counter;
it=m[0].second;
}
if(new_counter!=delete_counter)
std::cout<<"Leak detected!\n";
else
std::cout<<"Semms ok...\n";
cin>>myend;
return 0;
}
If you did as the follow steps, you willsee the resul “Semms ok…”.
- Compiling newest Boost_1_53_0 with VS2008
- Live555: Compiling with VS2008
- Compiling Java with GCJ
- Compiling Java with makefile
- Compiling OpenSSL with MinGW
- asterisk compiling with mp3
- Compiling VIM with python support
- Compiling with the Java Compiler API
- MinGW - Compiling and Building with MinGW
- Compiling Hydrax 0.5.1 with Ogre 1.7
- compiling-python-with-ssl-support问题
- Compiling Hydrax 0.5.1 with Ogre 1.7
- Compiling and building a project with rebar
- Compiling shared PECL extensions with phpize
- Error compiling OSSEC HIDS with Mysql support
- Compiling Lua with Visual Studio 2010
- Compiling a MEX file with Visual Studio
- c++ unordered_map compiling issue with g++
- 在WinXP上编译Doom3源码提示
- DOOM3 源码分析笔记(1)
- 第九章 OGRE中的整个流程
- leetcode: Palindrome Partitioning II解法
- 自动化管理SSH密匙的建议
- Compiling newest Boost_1_53_0 with VS2008
- IOS开发网络加载图片缓存策略之──ASIDownloadCache缓存策略
- [Latex][beamer]PGF and TiKz中演示文字沿路径移动的动画
- [Latex][beamer]PGF and TiKz中如何定位曲线路径上的任一点
- Codeforces Round #179 (Div. 2) C Greg and Array
- 【黑马程序员】ADO.NET访问EXCEL(学习笔记)
- XDU 1010
- 云计算应用开发实践学习笔记
- osglauncher例子