Sun C++ 5.0 question: ambiguity of mbstate_t
807575Sep 19 2001 — edited Nov 2 2001Dear Sun C++ users,
I recently installed Sun C++ 5.0 on my Solaris 8 machine.
The following simple example:
#include <iostream>
int main()
{
std::cout << "Hello, World!" << std::endl;
}
should compile under Sun's CC version 5.0, but it complains as follows:
$ CC -o test test.cc
"/usr/include/iso/wchar_iso.h", line 100: Error: Multiple declaration for mbsta\te_t.
"/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 51: Error: The name mbstate_t i\s ambiguous, std::mbstate_t and std::mbstate_t.
"/opt/SUNWspro/SC5.0/include/CC/./iosfwd", line 78: Error: The name mbstate_t i\s 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.
If I modify this code to:
#include <iostream.b>
int main()
{
cout << "Hello, World!" << endl;
}
it produce the same errors.
If I compile the above modified code with -compat=4 flag,
$ CC -compat=4 -o test test.cc
Then it works.
I really would like to know what is wrong with the version 5.
Any help is greatly appreciated.
Best regards,
--
Naoki Saito (UC Davis)