当采用静态连接,定义了:,_STLP_USE_STATIC_LIB
string的下面红色代码出错,采用动态库,却没有发现这个问题
template <bool __threads, int __inst>
void* _STLP_CALL
__node_alloc<__threads, __inst>::_M_allocate(size_t __n) {
void* __r;
_Obj * _STLP_VOLATILE * __my_free_list = _S_free_list + _S_FREELIST_INDEX(__n);
// # ifdef _STLP_THREADS
/*REFERENCED*/
_Node_Alloc_Lock<__threads, __inst> __lock_instance;
// # endif
// Acquire the lock here with a constructor call.
// This ensures that it is released in exit or during stack
// unwinding.
if ( (__r = *__my_free_list) != 0 ) {
*__my_free_list = ((_Obj*)__r) -> _M_free_list_link;
} else {
__r = _S_refill(__n);
}
解决办法:
使用动态库的STLPORT