【STLPort】STLPort的使用

STLPort是C++标准库的一个高效实现

具有高度的可移植性,最新版本是5.21版,

先下载“STLport-5.2.1.tar.bz2”,解压到D:\develop\STLport-5.2.1

使用时要先编译

1,从开始菜单运行vs2005的命令行提示工具“Visual Studio 2005 Command Prompt”;

2,cd进入D:\develop\STLport-5.2.1目录;

3,执行”configure msvc8”(vc6使用msvc6,vc9即vs2008使用msvc9)

4,执行”cd D:\develop\STLport-5.2.1\build\lib”

5,执行”nmake -f msvc.mak clean install”;

编译生成的dll和lib在STLport-5.2.1\lib和STLport-5.2.1\bin下,最后可以将STLport-5.2.1\build\lib 下的obj目录删除以节约硬盘空间。

vs配置

Tools/Options/Projects and Solutions/VC++ Directories/

选择Include files加入D:\develop\STLport-5.2.1\stlport(在前)和D:\develop\ boost_1_50_0\(在后)并调到最前

选择Library files加入D:\develop\STLport-5.2.1\lib并调到最前

实际工程中:

再打开Project/Properties

在配置属性/常规下将字符集设为Not set;

在C/C++下的“代码生成”处,选择运行时库为MTd

Debug版工程,需要在“C/C++”的预处理器中定义宏:__STL_DEBUG; 在Debug下与Boost配合使用,要定义宏:_STLP_DEBUG

原文地址:https://www.cnblogs.com/elesos/p/2756282.html