(转)stlport使用注意

使用STLport注意.
2007-11-14 21:05

1. 如果不打算使用iostream而只使用STL,不必编译STLport,
把stlport/stl/config/user_config.h中的:
/*
#define _STLP_NO_IOSTREAMS 1
*/
改成:
#define _STLP_NO_IOSTREAMS 1
在你的项目中确保stlport下的文件先被编译器搜索到。

2. STLport 不支持单线程运行时库,而vc6控制台程序默认采用单线程运行时库.

STLport 5.1.4 是不支持单线程运行时库的,如果你遇到下列错误,
请在VC6: Project > Settings > C/C++ > Code Generation >
Use run-time library:
不要选择single threaded或者debug single threaded.
其他MD,MDd,MT,MTd都是可以的.


Linking...
t01.obj : error LNK2001: unresolved external symbol "class stlpmtx_std::basic_ostream > stlpmtx_std::cout" (?cout@stlpmtx_std@@3V?$basic_ostream@DV?$char_traits@D@stlpmtx_std@@@1@A)
t01.obj : error LNK2001: unresolved external symbol "private: static void __cdecl stlpmtx_std::D__A::_M_deallocate(void *,unsigned int)" (?_M_deallocate@D__A@stlpmtx_std@@CAXPAXI@Z)
t01.obj : error LNK2001: unresolved external symbol "private: static void * __cdecl stlpmtx_std::D__A::_M_allocate(unsigned int &)" (?_M_allocate@D__A@stlpmtx_std@@CAPAXAAI@Z)
t01.obj : error LNK2001: unresolved external symbol "protected: void __thiscall stlpmtx_std::ios_base::_M_throw_failure(void)" (?_M_throw_failure@ios_base@stlpmtx_std@@IAEXXZ)
t01.obj : error LNK2001: unresolved external symbol "public: __thiscall stlpmtx_std::locale::~locale(void)" (??1locale@stlpmtx_std@@QAE@XZ)
t01.obj : error LNK2001: unresolved external symbol "public: class stlpmtx_std::locale::facet * __thiscall stlpmtx_std::locale::_M_use_facet(class stlpmtx_std::locale::id const &)const " (?_M_use_facet@locale@stlpmtx_std@@QBEPAVfacet@12@ABVid@12@@Z)
t01.obj : error LNK2001: unresolved external symbol "public: __thiscall stlpmtx_std::locale::locale(class locale::locale const &)" (??0locale@stlpmtx_std@@QAE@ABV01@@Z)
Release/t01.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

 

转自:http://hi.baidu.com/huangyinghui/blog/item/19a5c0cc3da8251301e92889.html

你可能感兴趣的:((转)stlport使用注意)