是否可以在托管 C++ DLL 中使用 stlport?
在我的项目中,我从 stlport 东西的链接器中收到了几个“未解决的令牌”错误。例如:
1>moc_ParentWidget.obj : error LNK2020: unresolved token (0A000819) "public: __thiscall stlp_std::allocator<unsigned short>::~allocator<unsigned short>(void)" (??1?$allocator@G@stlp_std@@$$FQAE@XZ)
1>ParentWidget.obj : error LNK2028: unresolved token (0A0008EB) "public: __thiscall stlp_std::allocator<unsigned short>::~allocator<unsigned short>(void)" (??1?$allocator@G@stlp_std@@$$FQAE@XZ) referenced in function "public: class stlp_std::allocator<unsigned short> __thiscall stlp_std::vector<unsigned short,class stlp_std::allocator<unsigned short> >::get_allocator(void)const " (?get_allocator@?$vector@GV?$allocator@G@stlp_std@@@stlp_std@@$$FQBE?AV?$allocator@G@2@XZ)
1>Terra3DViewNet.obj : error LNK2028: unresolved token (0A00087D) "public: __thiscall stlp_std::allocator<unsigned short>::~allocator<unsigned short>(void)" (??1?$allocator@G@stlp_std@@$$FQAE@XZ) referenced in function "public: class stlp_std::allocator<unsigned short> __thiscall stlp_std::vector<unsigned short,class stlp_std::allocator<unsigned short> >::get_allocator(void)const " (?get_allocator@?$vector@GV?$allocator@G@stlp_std@@@stlp_std@@$$FQBE?AV?$allocator@G@2@XZ)
1>moc_ParentWidget.obj : error LNK2028: unresolved token (0A000B9F) "public: __thiscall stlp_std::priv::_STLP_alloc_proxy<unsigned short *,unsigned short,class stlp_std::allocator<unsigned short> >::~_STLP_alloc_proxy<unsigned short *,unsigned short,class stlp_std::allocator<unsigned short> >(void)" (??1?$_STLP_alloc_proxy@PAGGV?$allocator@G@stlp_std@@@priv@stlp_std@@$$FQAE@XZ) referenced in function "public: __thiscall stlp_std::priv::_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >::_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >(unsigned int,class stlp_std::allocator<unsigned short> const &)" (??0?$_Vector_base@GV?$allocator@G@stlp_std@@@priv@stlp_std@@$$FQAE@IABV?$allocator@G@2@@Z)
1>ParentWidget.obj : error LNK2028: unresolved token (0A000CC2) "public: __thiscall stlp_std::priv::_STLP_alloc_proxy<unsigned short *,unsigned short,class stlp_std::allocator<unsigned short> >::~_STLP_alloc_proxy<unsigned short *,unsigned short,class stlp_std::allocator<unsigned short> >(void)" (??1?$_STLP_alloc_proxy@PAGGV?$allocator@G@stlp_std@@@priv@stlp_std@@$$FQAE@XZ) referenced in function "public: __thiscall stlp_std::priv::_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >::_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >(unsigned int,class stlp_std::allocator<unsigned short> const &)" (??0?$_Vector_base@GV?$allocator@G@stlp_std@@@priv@stlp_std@@$$FQAE@IABV?$allocator@G@2@@Z)
1>Terra3DViewNet.obj : error LNK2028: unresolved token (0A000C5B) "public: __thiscall stlp_std::priv::_STLP_alloc_proxy<unsigned short *,unsigned short,class stlp_std::allocator<unsigned short> >::~_STLP_alloc_proxy<unsigned short *,unsigned short,class stlp_std::allocator<unsigned short> >(void)" (??1?$_STLP_alloc_proxy@PAGGV?$allocator@G@stlp_std@@@priv@stlp_std@@$$FQAE@XZ) referenced in function "public: __thiscall stlp_std::priv::_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >::_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >(unsigned int,class stlp_std::allocator<unsigned short> const &)" (??0?$_Vector_base@GV?$allocator@G@stlp_std@@@priv@stlp_std@@$$FQAE@IABV?$allocator@G@2@@Z)
1>moc_ParentWidget.obj : error LNK2020: unresolved token (0A000DE1) "public: void __thiscall stlp_std::allocator<unsigned short>::deallocate(unsigned short *,unsigned int)" (?deallocate@?$allocator@G@stlp_std@@$$FQAEXPAGI@Z)
1>ParentWidget.obj : error LNK2028: unresolved token (0A000F27) "public: void __thiscall stlp_std::allocator<unsigned short>::deallocate(unsigned short *,unsigned int)" (?deallocate@?$allocator@G@stlp_std@@$$FQAEXPAGI@Z) referenced in function "public: __thiscall stlp_std::priv::_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >::~_Vector_base<unsigned short,class stlp_std::allocator<unsigned short> >(void)" (??1?$_Vector_base@GV?$allocator@G@stlp_std@@@priv@stlp_std@@$$FQAE@XZ)
...
我检查了这些函数是否包含在 stlport 库/DLL 中,并且这些函数存在一个稍微不同的未修饰名称。所以我想调用约定有问题!?有任何想法吗?