天天看点

VC6中使用STLPort 5.1

编译方法用以下批处理

 这里给一个批处理编译的

D:

cd "D:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin"

call VCVARS32.BAT

cd D:\STLport5\build\lib

call configure -c msvc6

call nmake /fmsvc.mak install

pause

********************************************

如果和PlatformSDK 一起使用的话

要记的在STLport目录中 /stlport/stl/config/user_config.h 文件中

把这一句打开

     # define _STLP_NEW_PLATFORM_SDK 1

否则在编译时会有如下错误

second C linkage of overloaded function 'InterlockedIncrement' not allowed

********************************************

如果想静态链接 STLPort 请在VC6的 C/C++ / General / Preprocessor definitions

中添加宏 _STLP_USE_STATIC_LIB

********************************************

对於使用IOSTREAM的, 如果有问题

在STLport目录中 /stlport/stl_user_config.h 文件中

把这一句打开吧

    # define _STLP_NO_IOSTREAMS 1

********************************************

- When you erase an element from a hash_map only iterators to the erased element are invalidated

  so you can write something like:

while (it != myHashMap.end()) {

if (condition)

 myHashMap.erase(it++); //这里为何这样不出错 而把it++放外面就不行呢

    //在外面是对删除后的无效指针加, 而里面是对有效指针加

else

 ++it;

}

  To finish STLport has a special debug mode to check such bad construction. Check the

  stl_user_config.h file in the stlport folder for that, the macro is _STLP_DEBUG.