Sun Studio 9 C++ compiler 5.6 Multiple declaration for std::strstreambuf::

Hi,

I am moving my C++ program library code etc to new version of Compiler Sun Studio 9 from Sun Forte Developer 7 complier.

When I am trying tomake my string class library I am geting following errors [b]with or without[/b] compat=5 flag.

Please help me to compile my library code using new compiler as I need to use this with new version of MQ 5.3.

Thanks

Ravi

++++++++++++++++++++++++++++++++++++++++++++++++++++++

CC -xar -compat=5 -xildoff -i -features=no%strictdestrorder -I. -I/ford/thishost/u/rbhave/mqrouter/include -c strfrnds.C

"/opt/SUNWspro/prod/include/CC/Cstd/./strstream", line 71: Error: Multiple declaration for std::strstreambuf::strstreambuf(char*, long, char*).

"/opt/SUNWspro/prod/include/CC/Cstd/./strstream", line 71: Error: A previously specified default argument value cannot be changed.

"/opt/SUNWspro/prod/include/CC/Cstd/./strstream", line 75: Error: Multiple declaration for std::strstreambuf::strstreambuf(const char*, long).

3 Error(s) detected.

*** Error code 3

make: Fatal error: Command failed for target `strfrnds.o'

++++++++++++++++++++++++++++++++++++++++++++++++++++++

[1199 byte] By [Ravi_Bhave] at [2007-11-26 11:01:31]
# 1

Hi

> CC -xar -compat=5 -xildoff -i

> -features=no%strictdestrorder -I.

> -I/ford/thishost/u/rbhave/mqrouter/include -c

> strfrnds.C

-compat=5 should make no difference.

You need to look in your source code plus the mqrouter/include source code to see which standard library headers are being included.

My guess is that you are including both strstream and the old stringstream.h, or something similar. You may need to use -library=iostream - see the CC manpage.

Paul

Paul_Floyd at 2007-7-7 3:15:16 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Thanks for your help. When I added -library=iostream in my Makefile the error has gone.Thanks again.Ravi
Ravi_Bhave at 2007-7-7 3:15:16 > top of Java-index,Development Tools,Solaris and Linux Development Tools...