• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 925
  • Last Modified:

Solaris 7 iostream and std::iostream error


I am trying to compile a library that is used to interact with custom hardware and its drivers.
When i compile the objects for the library i get the following errors.

"Exception.cpp", line 11: Error: The name ostream is ambiguous, ostream and std::ostream.
"Exception.cpp", line 13: Error: The type "ostream" is incomplete.

"av_tds.cpp", line 39: Error: The operation "std::ostream<<tds_Exception" is illegal.

These errors are repeated through the output.

I did try to use the flag -library=iostream which removes the above errors.
However  when i run a program that links and uses functions from my library the program it crashes on iostream_init.

(dbx) where
current thread: t@1
=>[1] Iostream_init::Iostream_init(0xdfa8e73c), at 0xdfa5302a
  [2] __SLIP.INIT_A(), at 0xdfa525ec
  [3] __STATIC_CONSTRUCTOR(), at 0xdfa532a8
  [4] __cplus_fini_at_exit(0xdfb4a154, 0x1), at 0xdfa74d28
  [5] setup(0x8047bfc, 0x8047c6c, 0x0, 0x8047fd0, 0x1000, 0xdfbce7af, 0xdfbfdf60, 0xdfbcd000, 0xdfbcd000, 0xffffffff, 0x8048034, 0x8047fd6, 0x8047bf4, 0xffffffff, 0x64, 0x64, 0xfa, 0xfa, 0x0), at 0xdfbd77a4
  [6] _setup(), at 0xdfbe10ba
  [7] _rt_boot(), at 0xdfbd019a

any help with this error wil be great!

Thanks in advance,
  • 4
  • 3
1 Solution
Which compiler are you using /usr/ucb/cc or GNU gcc?

You might need to apply 32-Bit Shared library patch for C++ and 64-Bit Shared library patch for C++ to your system the patch id for Solaris (Sparc) are: 106327-23  and
106300-24 .

if you are run Solaris 7 (x86) go to:
  have a look at Recommended Solaris Patch Clusters ReadMe file to find it out.

also have a look at the solution at:
__Michael__Author Commented:
Thankyou for your help yuzh,

I am using the following:

Sun ONE Studio 8 Compiler Collection
        Sun ONE Studio 8 Compiler Collection C
        Sun ONE Studio 8 Compiler Collection C++
        Sun ONE Studio 8 Compiler Collection Tools.h++ 7.1
        Sun ONE Studio 8 Compiler Collection Garbage Collector
        Sun ONE Studio 8 Compiler Collection DBX Debugging Tools
        Sun ONE Studio 8 Compiler Collection Performance Tools
        Sun ONE Studio 8 Compiler Collection Building Software
        Sun ONE Studio 8 Compiler Collection Documentation Set

version of "/opt/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.5 2003/03/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.5 2003/03/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.1 2003/03/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Performance Tools 7.1 2003/03/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.3 2003/03/12

Applying the reccomended solaris 7 patches today. Hopefully this will help solve the problem. Also have read through the openh323 problem, there are some similarities in this. Hopfully this will help too.

If there are any more suggestions, please advise.

You can also get the free GNU gcc complier binary package from:
    the installation procedure http:Q_21099108.html (I wrote it for Solaris 8, for Solaris
7 is the same).

    BTW, Solaris 7 in very old, consider update your system to Solaris 9 or Solaris 10
at least Solaris 8. (Free OS download, CD images)

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

__Michael__Author Commented:
Ok i have installed the recommended set of patches for sol 7.

However this had not helped my problem. same issue.

I cannont use solaris 9 as my hardware is on the ISA bus and for some reason solaris does not detect it. I have not tried 8.

The original drivers and library was written for solaris 2.5.1, i am trying to port them to 7 so we have use of more up to date computer, but still retaining the legacy ISA slots that are a requirment of the custom hardware.

I will continue to source what is causing this problem.


btw. thankyou for your help so far.
Have you try to use gcc? (mix up different version library might cause problem)

If you try gcc make sure that you remember to set PATH and LD_LIBRARY_PATH, see the link in my previous comment for details.
__Michael__Author Commented:
Ok I have sussed out he problem!

My code does not work with SUN CC 5.5.

Therefore I have included the /opt/SUNWspro/lib/CC4 library's which are version 4.2.
Also added the flag -compat=4 to my makefile.

All compiled with no errors or warnings.

However for some reason the code is not catching exceptions.
Always the same with porting fix one problem and it leads to the next!
Agreed with PAQ/refund.
PAQ-ing the question and refunding 500 points

Thanks yuzh !


Community Support Moderator
Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now