cast_stream not declared error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Need some help from g++ gurus regarding an error with g++ that I'm not
with xlC or VS2005.
My code was written in vs2005 and needs to be ported to the AIX 5.3
enviroment.  I'm using UCLA prebuilt binaries.

It's compiles fine in VS2005 and when I tried it with xlC, that worked
too.  However, when I tried it with g++, I get the following:

ADF_StringUtilities.h: In function 'std::string valToStr(AnyType,
size_t)':
ADF_StringUtilities.h:35: error: 'cast_stream' was not declared in this
scope
ADF_StringUtilities.h:35: error: expected primary-expression before '>'
token


So the code is in a header file:
----------------------------------------------------------
#include <sstream>
#include <string>
using namespace std;

template<typename AnyType>
string valToStr(AnyType val, string::size_type fieldWidth)
{
	string str = cast_stream < string > (val); 
    str.insert(0, fieldWidth-str.length(),' ');
	return str;
}
----------------------------------------------------------

This is the version that I'm using:

> g++ -v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../gcc-4.1.1/configure --disable-nls
Thread model: aix
gcc version 4.1.1


Any ideas why this error is occuring?

Thanks!


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux