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

eric@AI.MIT.EDU (Eric Hanchrow) (11/21/90)

I suspect this question has been asked a million times before, but
I've never read this group... anyway, is there anything special I need
to do to compile the NIH class library with g++?  I've got version
2.204a of the NIH class library, 1.37.0 g++, a Sun Sparc 1 (4/60), and
SunOS 4.0.3c.

Please respond via email to the address below.

Thanks!
       ------------------------------------------------------------------------
       |Eric Hanchrow		nosun.west.sun.com!yamada-sun!eric	      |
       |Phase III Logic, Inc.	cse.ogi.edu!yamada-sun!eric		      |
       |1600 N.W. 167th Place		Beaverton, OR 97006-4800 USA	      |
       |Voice: (503)-645-0313		Fax: (503)-645-0207     as of 4-Oct-89|
       --------------Crackling-noises-OK--do-not-correct!----------------------

mimivo@ibmpa.awdpa.ibm.com (Mimi Phu+o+ng-Tha?o Vo~) (04/26/91)

Does anyone know what is "fd_set" used in FDSet.h of NIHCL?
Is it a struct or a class?  Which header supposes to declare
it?  I am trying to port this library but both AT&T 2.1 C++
and g++ header files do not have this struct/class/or whatever
it is.

Thanks,
Mimi.


-- 
========================================================================
Name:	Mimi Phuong-Thao Vo		Org.:	IBM AWD Palo Alto	
Phone:	T465/(415)855-4467 		Disc:	"Any opinions are mine!"
email:  mimivo@ibmpa.awdpa.ibm.com      uucp:   ...!uunet!ibmsupt!mimivo
========================================================================

eroberts@convex.com (Evan Roberts) (04/27/91)

In <1991Apr26.094237@ibmpa.awdpa.ibm.com> mimivo@ibmpa.awdpa.ibm.com (Mimi Phu+o+ng-Tha?o Vo~) writes:

>Does anyone know what is "fd_set" used in FDSet.h of NIHCL?

When using the select(2) system call a bit string is returned when a file
descriptor can support I/O with out blocking. The structure defined for this
bit string is called fd_set. It is defined in /usr/include/sys/types.h
See the man page on select(2)

Evan R.

mimivo@ibmpa.awdpa.ibm.com (Mimi Phu+o+ng-Tha?o Vo~) (04/30/91)

Thanks everyone for helping with the fd_set structure problem.
I found out that we have it in our system in /usr/include/sys/select.h.
I need to define _BSD in order to get to this structure.

However, I just found a new problem and wonder if you could help me:
The class FDSet was defined as

class FDSet: public VIRTUAL Object {
	....
  private:
	fd_set	fs;
  protected:
	virtual void storer(OIOofd&) const;
	virtual void storer(OIOout&) const;
  	....
};

where fd_set is

typedef struct fd_set {
	fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;

And in FDSet.c we have the following:

void FDSet::storer(OIOofd& fd) const
{
    BASE::storer(fd);
    fd.put((const char*)&fs,(unsigned)sizeof(fs));
}

Which AT&T C++ compiler on my system complaints that you could
not take address of member FDSet::fs of const struct FDSet

Did anyone run into this problem when they were trying to build it?
Or my NIHCL is out of date.

Thanks,
Mimi.

-- 
========================================================================
Name:	Mimi Phuong-Thao Vo		Org.:	IBM AWD Palo Alto	
Phone:	T465/(415)855-4467 		Disc:	"Any opinions are mine!"
email:  mimivo@ibmpa.awdpa.ibm.com      uucp:   ...!uunet!ibmsupt!mimivo
========================================================================