Mail Archives: djgpp/1996/02/04/11:32:01
This is a multi-part message in MIME format.
--------------7BE229E763EA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
When trying to compile the attached program, I get an >undefined
reference to '_iob'< for an output. What am I doing wrong?
--
William A.Orlowski E-MAIL: orlo AT emi DOT net
WWW: http://www.lookup.com/homepages/56215/home.html
--------------7BE229E763EA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="PRINT_IT.c"
/* PRINT_IT.C--This program prints a listing with line numbers! */
#include <stdio.h>
void do_heading(char *filename);
int line, page;
main( int argv, char *argc[] )
{
char buffer[256];
FILE *fp;
if( argv < 2 )
{
fprintf(stderr, "\nProper Usage is: " );
fprintf(stderr, "\n\nPRINT_IT filename.ext\n" );
exit(1);
}
if (( fp = fopen( argc[1], "r" )) == NULL )
{
fprintf( stderr, "Error opening file, %s!", argc[1]);
exit(1);
}
page = 0;
line = 1;
do_heading(argc[1]);
while( fgets( buffer, 256, fp ) != NULL )
{
if( line % 55 == 0 )
do_heading( argc[1] );
fprintf( stdout, "%4d:\t%s", line++, buffer );
}
fprintf( stdprn, "\f" );
fclose(fp);
return 0;
}
void do_heading(char *filename )
{
page++;
if ( page > 1)
fprintf( stdprn, "\f" );
fprintf( stdprn, "Page: %d, %s\n\n", page, filename );
}
--------------7BE229E763EA--
- Raw text -