Mail Archives: djgpp/1997/12/26/05:46:40
From: | "John M. Aldrich" <fighteer AT cs DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Silly Elementary Question
|
Date: | Wed, 24 Dec 1997 20:51:36 -0500
|
Organization: | Two pounds of chaos and a pinch of salt.
|
Lines: | 67
|
Message-ID: | <34A1BC28.6306@cs.com>
|
References: | <01bd10b8$85d81640$893b37a6 AT jim>
|
Reply-To: | fighteer AT cs DOT com
|
NNTP-Posting-Host: | ppp228.cs.com
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
jsmith2 wrote:
>
> Howdy! I just downloaded and installed gcc and rhide, and I'm getting an
> error that I can't figure out when I try to compile a simple C program --
> surely due to my own ignorance:
>
> Error: stdio.h: No such file or directory (ENOENT)
This error means that DJGPP couldn't find the file. ENOENT is the
internal name of the POSIX error code that means, "file not found." :-)
The overwhelmingly likely reason for this error is that you simply did
not set up your environment correctly as instructed in the file
'v2/readme.1st'. Please make sure that you have:
a) Properly unzipped the DJGPP files, preserving the directory
structure.
b) Set your DJGPP environment variable correctly in 'autoexec.bat'.
Since you seem (by your example) to have installed it in d:\djgpp, the
correct setting is thus:
SET DJGPP=D:\DJGPP\DJGPP.ENV
Incorrect settings might be:
SET DJGPP = D:\DJGPP\DJGPP.ENV (no spaces!!)
SET DGJPP=D:\DJGPP\DJGPP.ENV (misspelled)
SET DJGPP=D:\DJGPP (the file, not the directory)
c) Not changed or edited 'djgpp.env' in any way.
If all else fails, please post a system report as described in chapter
6.12 of the DJGPP Frequently Asked Questions list (v2/faq210b.zip or
online at http://www.delorie.com/djgpp/v2faq/). You might also want to
try out my DJVERIFY diagnostic utility, which is in prerelease testing
at the moment. Please note that the latest version is WIP; it's not
official. Email me for more information.
> I tried to include stdio.h two ways; like this:
>
> #include <stdio.h>
>
> and like this:
>
> include "d:\djgpp\include\stdio.h"
One last note. In C/C++ string and character literals, the '\'
(backslash) character is an escape code. When you write a string that
needs literal backslashes, you have to double them up ("\\"). A better
choice is to use forward slashes, which are understood by both DOS and
DJGPP. The following will both work:
#include "d:\\djgpp\\include\\stdio.h"
#include "d:/djgpp/include/stdio.h"
However, explicitly specifying the path to a standard header should
NEVER be necessary. Don't do it!
hth
--
---------------------------------------------------------------------
| John M. Aldrich | "To be 'matter of fact' about the |
| aka Fighteer I | world is to blunder into fantasy-- |
| mailto:fighteer AT cs DOT com | and dull fantasy at that, as the real|
| http://www.cs.com/fighteer | world is strange and wonderful." -LL |
---------------------------------------------------------------------
- Raw text -