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

Solaris 7 iostream and std::iostream error

Gday,

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
(dbx)

any help with this error wil be great!

Thanks in advance,
Michael
0
__Michael__
Asked:
__Michael__
  • 4
  • 3
1 Solution
 
yuzhCommented:
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:
http://sunsolve.sun.com/private-cgi/show.pl?target=patches/patch-access
  have a look at Recommended Solaris Patch Clusters ReadMe file to find it out.

also have a look at the solution at:
http://www.openh323.org/pipermail/openh323/2004-April/067661.html
0
 
__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.

Regards,
Michael
0
 
yuzhCommented:
You can also get the free GNU gcc complier binary package from:
    http://sunfreeware.com/
    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)

    http://www.sun.com/software/solaris/binaries_program.xml
    http://www.sun.com/software/solaris/9/
    http://www.sun.com/software/solaris/8/
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
__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.

Regards,
Michael

btw. thankyou for your help so far.
0
 
yuzhCommented:
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.
0
 
__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!
0
 
yuzhCommented:
Agreed with PAQ/refund.
0
 
moduloCommented:
PAQ-ing the question and refunding 500 points

Thanks yuzh !

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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