Solaris 7 iostream and std::iostream error

Posted on 2005-05-15
Last Modified: 2013-12-26

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,
Question by:__Michael__
    LVL 38

    Expert Comment

    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:

    Author Comment

    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.

    LVL 38

    Expert Comment

    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)

    Author Comment

    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.
    LVL 38

    Expert Comment

    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.

    Author Comment

    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!
    LVL 38

    Expert Comment

    Agreed with PAQ/refund.

    Accepted Solution

    PAQ-ing the question and refunding 500 points

    Thanks yuzh !


    Community Support Moderator
    Experts Exchange

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now