2 msgNeed some help on the options of g++
4 msgAdding marker (.dot) instructions at procedure ...
2 msggcc_assert()
4 msginsn_condition table
1 msggfortran case sensitive
2 msgIssue group
3 msgC++ error: cannot convert 'unsigned int A::*' t...
2 msgFwd: How to deliver my source code???

cast_stream not declared error
\ Ferng, Andrew D (26 Oct 2006)
. \ John \(Eljay\) Love-Jensen (26 Oct 2006)
. . \ Ferng, Andrew D (27 Oct 2006)

3 msgSyntax Problem
3 msggcc 1.95.3 on solaris 9
2 msgIncluding static libraries
2 msgSeveral GCC Versions
1 msgProblem with gcc-4.0.0
19 msgValgrind - exact leak location.
2 msgcannot link an .o file
3 msgSelect instruction support in GCC
1 msgRe: Problems shifting an int 32 times. Gcc 3.4.5
2 msgg++ compile problem using inttypes.h
2 msgnamespaces composition and selection
Subject:cast_stream not declared error
Group:Gcc-help
From:Ferng, Andrew D
Date:26 Oct 2006


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!


© 2004-2008 readlist.com