Sun Workshop 5 C++ compiler problem on Solaris 8

Sun Workshop 5 C++ compiler problem on Solaris 8

Post by chi zhan » Wed, 31 Oct 2001 10:11:09



Dear All,

I'm planning do some c++ coding on the the UltraSparc system in our group.
We had Sun Workshop 5 and Solaris 8 installed, and to test the c++
compiler, I wrote the very basic hello.cpp shown below
*******************************************************
#include <iostream.h>

int main(int argc, char **argv)
{
        cout << "hello world"<<endl;
  return 0;

Quote:}

*******************************************************
but I faced a really wired phenomena as below:
*******************************************************
~> CC hello.cpp
"/usr/include/iso/wchar_iso.h", line 100: Error: Multiple declaration for
mbstate_t.
"/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 51: Error: The name
mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
"/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 78: Error: The name
mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
"/opt/SUNWspro/SC5.0/include/CC/rw/iotraits", line 56: Error: The name
mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
4 Error(s) detected.
*******************************************************
I can't figure out what the problem, and we have been using fortran
and C successfully before.  Is there anyone faced this problem before?
I'm really frustrated by it, any suggestions or comments will greatly
appreciated.

Thanks,

-Chi

 
 
 

Sun Workshop 5 C++ compiler problem on Solaris 8

Post by John Howell » Wed, 31 Oct 2001 17:16:39



> Dear All,

> I'm planning do some c++ coding on the the UltraSparc system in our group.
> We had Sun Workshop 5 and Solaris 8 installed, and to test the c++
> compiler, I wrote the very basic hello.cpp shown below
> *******************************************************
> #include <iostream.h>

> int main(int argc, char **argv)
> {
>         cout << "hello world"<<endl;
>   return 0;
> }
> *******************************************************
> but I faced a really wired phenomena as below:
> *******************************************************
> ~> CC hello.cpp
> "/usr/include/iso/wchar_iso.h", line 100: Error: Multiple declaration for
> mbstate_t.
> "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 51: Error: The name
> mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
> "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 78: Error: The name
> mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
> "/opt/SUNWspro/SC5.0/include/CC/rw/iotraits", line 56: Error: The name
> mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
> 4 Error(s) detected.
> *******************************************************
> I can't figure out what the problem, and we have been using fortran
> and C successfully before.  Is there anyone faced this problem before?
> I'm really frustrated by it, any suggestions or comments will greatly
> appreciated.

Yes, you need the patches from:

http://access1.sun.com/patch.public/cgi-bin/show_list.cgi/wrk/
                                WorkShop_Compilers_C_C++_SPARC32bit

but I'm not sure which one exactly fixes that particular problem.

John Howells
Marconi

 
 
 

Sun Workshop 5 C++ compiler problem on Solaris 8

Post by Richard Mason » Thu, 01 Nov 2001 02:08:52


Quote:> > #include <iostream.h>

Note that the use of <iostream.h> is deprecated.  Use <iostream> instead.

RFM

 
 
 

Sun Workshop 5 C++ compiler problem on Solaris 8

Post by Michael Schloh von Bennewit » Thu, 01 Nov 2001 03:54:52



> Note that the use of <iostream.h> is deprecated.  Use <iostream> instead.

> RFM

Hello Richard,

Do you mean that iostream.h is deprecated only with Forte C++ or in
general. I haven't heard about this and have been using iostream.h quite
happily ;-)

Michael

 
 
 

Sun Workshop 5 C++ compiler problem on Solaris 8

Post by Thomas Deh » Thu, 01 Nov 2001 05:02:47




> > Note that the use of <iostream.h> is deprecated.
> >  Use <iostream> instead.

> > RFM

> Hello Richard,

> Do you mean that iostream.h is deprecated only with Forte C++ or in
> general. I haven't heard about this and have been using iostream.h quite
> happily ;-)

iostream.h is classic/ARM C++ (-compat=4 with CC)
iostream is ANSI/ISO C++ (default, -compat=5 with CC)
You can use iostream.h with -compat=5, but depending
on what you use (e.g. the tools.h++)
you might have to set compiler flags
such as -library=iostream

Thomas

 
 
 

Sun Workshop 5 C++ compiler problem on Solaris 8

Post by Ian Colli » Thu, 01 Nov 2001 07:14:49



> Dear All,

> I'm planning do some c++ coding on the the UltraSparc system in our group.
> We had Sun Workshop 5 and Solaris 8 installed, and to test the c++
> compiler, I wrote the very basic hello.cpp shown below
> *******************************************************
> #include <iostream.h>

> int main(int argc, char **argv)
> {
>         cout << "hello world"<<endl;
>   return 0;
> }
> *******************************************************
> but I faced a really wired phenomena as below:
> *******************************************************
> ~> CC hello.cpp
> "/usr/include/iso/wchar_iso.h", line 100: Error: Multiple declaration for
> mbstate_t.
> "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 51: Error: The name
> mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
> "/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 78: Error: The name
> mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
> "/opt/SUNWspro/SC5.0/include/CC/rw/iotraits", line 56: Error: The name
> mbstate_t is ambiguous, std::mbstate_t and std::mbstate_t.
> 4 Error(s) detected.
> *******************************************************
> I can't figure out what the problem, and we have been using fortran
> and C successfully before.  Is there anyone faced this problem before?
> I'm really frustrated by it, any suggestions or comments will greatly
> appreciated.

> Thanks,

> -Chi

Either compile with -library=iostream, or use the standard header
<iostream>, or both.  I tended to stick with -library=iostream with
either header in 5.0.

iostream suff is not that good in 5.0, do add the patches and consider
an upgate to 6.2, it's much better in this area.

Ian

 
 
 

1. Problem with Sun Workshop C++ compiler

Hi All,
    I am using Sun Workshop 5.0.  for binary compatability I am using
compat=4 flag.   My code is compiled with features=rtti flag.  But I
have a library which is not compiled with this flag.  when I try to
link  Iget errors like.
        __rtacess__XYZ  unresolved symbol.

where XYZ is some class in the libraray not linked with rtti.  Is there
a way to overcome this problem.  Is it possible to mix libraries
compiled with and without features=rtti flag.

Thnaks in advance.

regards,
Prakash.

2. Change a particular group's GID on files system-wide

3. undefined symbol ::__vtbl with Sun WorkShop 6 update 1 C++ Compiler (5.2)

4. SCSI Error with Orb drive

5. SUN Workshop C++ Compiler Error

6. automounter on RS/6000

7. Are sun studio C/C++ compilers and Forte C/C++ compilers same ??

8. Help X11

9. Sun Workshop 4.2 C++ Compiler - debug symbol format not understood by debuggers

10. SUN Workshop C++ Compiler Error

11. Looking for Sun WorkShop C++ Compiler 5.0

12. SUN Workshop C++ Compiler 5.0 dead slow

13. Linking errors on SunOS 5.8 Sun WorkShop 6 update 1 Compilers C++