Re: Sane on NeXT/OpenStep - a plea for help

Gordon Matzigkeit (gord@m-tech.ab.ca)
15 Jun 1997 17:12:59 -0600

Hi!

>>>>> Neville Wilford writes:

>> I believe the C compiler gave correct error messages. Somehow,
>> your `read' and `write' functions have not been
>> declared. Normally, these functions are declared by the `unistd.h'
>> header file.

NW> phaedrus:30# find / -name unistd.h -print
NW> /NextDeveloper/Headers/bsd/unistd.h

Good show. Root finds always help. ;)

NW> I'm hoping this might count as a significant clue.

It does. What it implies, along with the results you posted below, is
that the BSDish header files are stored under the
/NextDeveloper/Headers/bsd directory.

NW> Is "-I../include -I../include -arch i386 -undef " something to do
NW> with the problem?

I don't think so.

>> What you are interested in is finding the declarations of the
>> `read' and `write' system functions in your system header files.

/NextDeveloper/Headers/bsd/libc.h:extern int read(int, void *, int), \
write(int, const void *, int);

Congratulations! You found it!

NW> Thanks again, but I don't think I'm doing very well here. Sorry
NW> to be such a complete dimwit. Is it possible that putting
NW> /NextDeveloper/Headers/bsd somewhere in the include path might be
NW> helpful?

No, on the contrary, I think you are doing very well.

I think all you need to fix your problem is to make the following
change to source files that fail to compile:

#include <unistd.h>
#include <libc.h> /* Add this line! */

If you want to give me access to your OpenStep box, which you offered,
then I would be more than happy to help port SANE to OpenStep. If
you're interested, I like accounts named `gord'. ;)

On the other hand, if you want to try porting to OpenStep yourself, it
should be relatively easy. Part of the battle would be to see if
`libc.h' is automatically #included by any of the other files in
/NextDeveloper/Headers/bsd. If not, then #including it directly, as I
did above, is probably the right solution.

If that's all that gives you trouble, then the patches to SANE are
quite trivial. Just tell us which of the SANE files fail to compile
without the above patch, and then we can add an Autoconf macro to
include `libc.h' in those files.

Good luck,

-- 
  Gord Matzigkeit   | Proudly running pieces of the GNU operating system.
 gord@m-tech.ab.ca  |  Jacques Cousteau loved programming in assembler.

--
Source code, list archive, and docs: http://www.azstarnet.com/~axplinux/sane/
To unsubscribe: mail -s unsubscribe sane-devel-request@listserv.azstarnet.com