News | Articles | Libraries | Developer Tools | Books | Forum Links | Search   
Sections:
 

QA: How to use STLPort on Pocket PC?

By Andrey Yatsyk, October 08, 2001.
Print version

Question

I know that STLPort is one of the best portable STL libraries. How can I use STLPort with my embedded Visual C++ program?

Answer

STLPort is one of the most widespread C++ standard library implementations. The last version may be downloaded from the following page: http://www.stlport.org/download.html. This standard library implementation is very portable and can be used with a number of compilers and operating systems. Meanwhile, STLPort does not support embedded Visual C++, however you can use a pretty large amount of C++ standard libraries.

STLPort supports two usage modes. First, the wrapper mode that relies on original (provided by compiler) stream library. The second mode uses STLPort own stream library that must be compiled as a static or a dynamic library and used with your application. I didn't have any success with STLPort streams compilation because of their dependance on header files and features that are not provided with embedded Visual Studio.

Thus, the only way is to use the wrapper mode and to avoid usage of streams and some features dependant on those not provided with embedded Visual Studio. The facilities that must work are containers, strings, algorithms, memory allocators and so on.

In order to use STLPort in your application you should make some changes in stlport\stl_user_config.h file. Insert the following definition into this file:

#define __PLACEMENT_NEW_INLINE

and uncomment the following definitions:

  • _STLP_NO_OWN_IOSTREAMS
  • _STLP_NO_NEW_IOSTREAMS
  • _STLP_NO_IOSTREAMS
It is recommended to insert stl include directives after "StdAfx.h" file inclusion. If you are upset by warnings you can add a corresponding #pragma warning in order to disable it.

Related resources:

Discuss

Discuss this article. Here you can write your comments and read comments of other developers.
Rate this article:     Poor Excellent    
 12345 
© 2001-2005 Pocket PC Developer Network, a division of Spb Software House