HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
ostr << “ or another” /*...*/ << endl;
cout.write(ostr.str().c_str(), ostr.str().length());
Note that cout.flush may be needed if sharing the file with stdio.
Required Command-line Options
To use the multi-thread safe capabilities of the Standard C++ Library, you need to specify
the following options at both compile and link time. Note that the options differ depending
on which set of libraries you are using.
Rogue Wave Standard C++ Library 2.2.1
For both 32-bit and 64-bit libraries:
• -D_RWSTD_MULTI_THREAD
• -D_REENTRANT
• -lpthread (This option applies only to kernel threads.)
• -mt
Rogue Wave Standard C++ Library 1.2.1 and Tools.h++ 7.0.6
For both 32-bit and 64-bit libraries:
• -D__HPACC_THREAD_SAFE_RB_TREE (Code compiled with this option is binary
incompatible with code that is not compiled with this option. Only HP aC++ version
A.01.21 and subsequent versions incorporate this option.)
• -DRWSTD_MULTI_THREAD
• -DRW_MULTI_THREAD (needed only for the Tools.h++ Library)
• -D_REENTRANT
• -lcma (This option applies only to user threads.)
• -lpthread (This option applies only to kernel threads.)
• -D_THREAD_SAFE (Unlike the other options in this table, this option is not required.
You can use it with the cout, cin, cerr, and clog objects, if you are not using
locks.)
• -mt
204 Exception Handling