🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #26132

Re: LSC and printf

#26132
From: LOCAL NODE: *INSERT COMMERCIAL H...
Date: Wed, 09 Mar 1988 15:39
26 lines
1059 bytes
>    I guess I am missing something in LightSpeed C. The following program
>compiles, but dies on link...... I guess I'm alittle green:
> 
>        #include "stdio.h"
>        main()
>        {
>           int i;
> 
>           i = 1;
>           while( i<=5 ) {
>              printf("%d\n",i);   /* can't find printf at link */
>              i= i + 1;
>           }
>        }
 
well...  there's a couple of things to try.  first, the #include line
should read :

#include <stdio.h>

it makes a difference as to where the compiler looks for the file.

as to the link error, you must include the "stdio" library in your project.
check the manual for more specifics.

good luck, rich
Technical Details
Message-ID: <8803091539.AA04425@decwrl.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!decvax!decwrl!colors.dec.com!long

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!decvax!decwrl!colors.dec.com!long
From: long@colors.dec.com (LOCAL NODE: *INSERT COMMERCIAL HERE*)
Newsgroups: comp.sys.mac
Subject: Re: LSC and printf
Message-ID: <8803091539.AA04425@decwrl.dec.com>
Date: 9 Mar 88 15:39:53 GMT
Organization: Digital Equipment Corporation
Lines: 26