If you're using 2.9X, I'd recommend using the StlPort streams library instead of gcc's.