delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/14/13:02:44

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: .h files unrecognised
Date: Sat, 14 Feb 1998 12:52:19 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 43
Message-ID: <34E5D9D3.5C94@cs.com>
References: <34E59182 DOT 80F AT which DOT net>
NNTP-Posting-Host: ppp209.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Andrew wrote:
> 
> I have tried to install djgpp on my pc but when I run a small test
> program it fails to detect the stdio.h file even though all the .h
> files are in the same directory as the program. If I enclose the
> stdio.h in quotes and not angle brackets ie. "stdio.h" not <stdio.h>,
> then the program can find the stdio.h file but it cannot find any of
> the files that stdio.h calls. Any help would be greatfully appeciated.

That's not how any compiler works, much less DJGPP.  Each type of file
(headers, libraries, binaries) has its own separate directory in the
DJGPP installation tree.  If you preserve the directory structure when
you unzip the DJGPP zipfiles, these directories should be created
automatically.  After that, all you have to do is set the two
environment variables that DJGPP requires and you're ready to go.

Under no circumstances should you write your program in the same
directory as the system headers, nor should you copy the system headers
into your program's directory.

I assume you didn't read the file named 'v2/readme.1st' that explains
exactly how to install and use DJGPP, or that you didn't understand what
you read.  Please try again and tell us if that helps.

> The program I have been trying is:
> 
> #include <stdio.h>
> void main (void)
> { printf ("Hello"); }

main() must return an integer according to the ANSI C standard. 
Declaring it as void, or omitting a 'return' statement can cause subtle
and hard to debug problems, particularly when using RHIDE.  Reference: 
comp.lang.c FAQ (http://www.eskimo.com/~scs/C-faq/top.html), questions
11.12 through 11.15.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "A generation which ignores history  |
|       aka Fighteer I       | has no past--and no future."         |
|   mailto:fighteer AT cs DOT com   |                                      |
| http://www.cs.com/fighteer |                - Lazarus Long        |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019