天天看点

dll导出类:成员函数中存在string类型导致编译报错 _acrt_first_block == header

根本原因:对象在析构时不正确的释放内存导致。

<code>std::string</code>是STL中定义的模板类,所以编译器在编译动态库时会将<code>std::string</code>实例化,在编译exe时也会将其实例化,也就是说有两套<code>std::string</code>实例代码分别在exe和dll中.

继续阅读