错误:'bad_alloc' : is not a member of 'stlp_std'
2007-05-30 11:37
603 查看
用ATL实现一个COM时发现编译错误:
'bad_alloc' : is not a member of 'stlp_std'
去除所有代码,找到有问题的代码行。
最后可用一行代码重现错误:
#include <new> // for std::bad_alloc
...
throw std::bad_alloc();
禁用STLPort库而使用VC6的原生stl库,没有错误,但有个警告:
warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX
问题看来一定是GX编译开关了。
ATL默认不打开异常处理,不过用到stl就必须打开。
看来ATL不鼓励使用stl,甚至要少用CRT,目的是生成最小的目标模块。
参考:
[1] ATL里用STL
[2] 使用STL类在ATL com中的问题
(转载请注明来源于金庆的专栏)
'bad_alloc' : is not a member of 'stlp_std'
去除所有代码,找到有问题的代码行。
最后可用一行代码重现错误:
#include <new> // for std::bad_alloc
...
throw std::bad_alloc();
禁用STLPort库而使用VC6的原生stl库,没有错误,但有个警告:
warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX
问题看来一定是GX编译开关了。
ATL默认不打开异常处理,不过用到stl就必须打开。
看来ATL不鼓励使用stl,甚至要少用CRT,目的是生成最小的目标模块。
参考:
[1] ATL里用STL
[2] 使用STL类在ATL com中的问题
(转载请注明来源于金庆的专栏)
相关文章推荐
- 继承QTreeWidgetItem发生error: 'staticMetaObject' is not a member of 'QTreeWidgetItem' 错误
- 'numeric_limits' is not a member of 'std'|
- cocos2dx ant编译'atoi' is not a member of 'std'
- error C2039: 'wstring' : is not a member of 'std'(转)
- 继承QTreeWidgetItem发生error: 'staticMetaObject' is not a member of 'QTreeWidgetItem' 错误
- error C2039: 'bitset' : is not a member of 'std'
- 'numeric_limits' is not a member of 'std'
- 'find_if’ is not a member of ‘std'
- cocos2d-x-2.2.5 Eclipse编译报错 error: 'transform' is not a member of 'std' (IOS没有问题)
- Blitz++ error: 'labs' is not a member of 'std'
- QT中的 'rand' is not a member of 'std'问题的解决
- C++11 'yield' is not a member of 'std::this_thread'
- 20140528 repo sync后发现的bug "replace is not a member of std"
- Qt 解决“is not a member of ‘std’”错误
- 实战c++中的智能指针unique_ptr系列-- 使用std::unique_ptr代替new operator(错误:‘unique_ptr’ is not a member of ‘std’)
- 今日download工程的奇怪问题error C2039: 'readStdErr' : is not a member of 'Programer',
- 'WriteHuge' : is not a member of 'CFile'
- 'SetWindowTextA' : is not a member of 'CString'
- 'GetCurSel' : is not a member of 'CTime'
- qt 错误:request for member 'show' in 'showlist_ui', which is of non-class type 'ShowList*'