Mail Archives: djgpp/1997/09/11/07:47:36
Br5an <br5an AT aol DOT com> wrote:
> takahashi writes,
> >i've been trying for the past couple of days trying to compile a >simple
> c program. its like this:
> >#include "stdio.h"
^^^^^^^^^^^^^^^^^^
Decent style rules say to write this #include <stdio.h> unless you have a
good reason not to; see below.
> >void main()
^^^^^^^^^^^
This should be int main(void)
> > {
> > printf("hello");
> > }
> >i have tried to compile this using rhide and everytime i get an
> >errormessage that says something like....
> >ERROR:c:\dos\rhaaaaa/
> >could not create hello.o or directory does not exist
A more exact error would help?
> >i stayed up all night trying to get it to work but never got it. any of
> >yall run into this kind of problem?
> It may be because you used
> #include "stdio.h" /* look in current directory */
> rather than
> #include <stdio.h> /* look in compiler include directory */
"Similarly, a control line of the form
" #include "filename"
"searches first in association with the original source file [...] and if
that search fails, then as if in the first [#include <filename>] form."
-- K&R, Section A12.4, Page 231
Therefore, while it is extremely bad style, #include "stdio.h" would work
correctly, unless some replacement "stdio.h" is found in the current
directory, in which case this was most likely the intent.
> also your autoexec.bat file should include something similar to this:
> SET PATH=%PATH%;C:\DJGPP\BIN
> SET DJGPP=C:\DJGPP\DJGPP.ENV
Yes, most likely the problem is with the setup. Are the mentioned variables
defined correctly? Were the archives unpacked with the correct directory
structure?
--
[- firewind -]
[- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -]
[- "You're just jealous because the voices talk to -me-." -]
- Raw text -