[comp.lang.c++] NIH Class Library Problem

mb@sparrms.ists.ca (Mike Bell) (05/14/91)

Has anybody successfully built and used version 3.0 of the NIH Class
library using Sun C++2.0 on a Sun 3? (SunOS 4.1)

(If you're unfamiliar with the NIH Class Library, it is descibed in the
excellent book "Data Abstraction and Object-oriented Programming in
C++", K.E.Gorlen, S.M.Orlow, & P.S.Plexico, Wiley 1991. It's available
by ftp, or for $16.95 from the publishers.)

I'm having a problem getting the startup code in the class library to
work: a procedure _main.c apparently seizes control before the main()
procedure in a program to initialise parts of the NIH class library.
Unfortunately, when I include this module in the library, it doesn't
appear to return control to the parts of the normal system library that
initialise static objects such as cin, cout, cerr. Consequently all the
test programs crash.

If I remove the _main.o module from the library, then certain NIH
classes (which depend upon the functionality of _main.o) no longer
work.

Anybody run into this one? Is there something obvious I'm missing?

(I've emailed the authors - but presumably they are on vacation as I've
received no reply yet).

kwh@stiatl.salestech.com (Kurt Hoyt) (05/17/91)

All the _main.c does is call NIHCL::initialize() in addition to the usual
stuff done in _main (). I couldn't use it in my environment, so I put the
call to NIHCL::initialize() as the first line in my programs which use the
NIH library and everything works just fine.

-- 
---------------------+
Kurt in Atlanta      |
kwh@salestech.com    | Latest version available now!
...!uupsi!stiatl!kwh |