ADC Home > Reference Library > Technical Q&As > Legacy Documents > Tools >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

Stubs.o vs. fgets


Q: We have a problem with the MPW SIOW and Stubs.o libraries. A program ("Show_bug") linked without either of these libraries works properly (the test sequence is basically an fopen followed by an fgets), but if the Stubs.o or the SIOW.o library is linked into the program, either nothing is returned by the fgets, or a ZcbFree error occurs during a call to fprintf.

The following list shows the target, the library that is linked, and the bug shown:

Target			Library	Bug
Show_bug		Stubs.o	the 'fgets' problem
Show_bug_NAKED	---		works as expected
Show_bug_SIOW		SIOW.o	ZcbFree error during fprintf

A: The Stubs.o library is intended for use in building MPW Tools, but the make file that you are using is building an application. Changing that to an MPW Tool should solve your problem. For a brief discussion of Stubs.o, see page 9-4 of Building and Managing Programs in MPW.

The SIOW library is intended for use in applications that perform simple I/O to a console. SIOW cannot be used with an application that opens windows. There is a warning to this effect on page 6-3 of Building and Managing Programs in MPW.

With regard to your Naked build, you should not be making calls to fgets or fprintf using stdout and stderr from within a "Mac-like" application, as indicated by the warning given in two of the dialogs put up by your Naked application.

[Jun 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.