您的位置:首页 > 其它

VC6中使用STLPort4.6.2

2009-08-17 13:33 507 查看
编译就不说了, 网上这方面的文章很多

********************************************
如果和PlatformSDK 一起使用的话
要记的在STLport目录中 /stlport/stl_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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: