Help: Newbie can't compile a ' Hello world' program

Help: Newbie can't compile a ' Hello world' program

Post by Daniel Che » Thu, 09 Apr 1998 04:00:00



I am a newbie to djgpp. I need some help to compile my first c program.
I outline below what I have done up till today.

I have downloaded the following zip files:

BNU281B.ZIP     GCC280B.ZIP     FAQ210B.ZIP     DJDEV201.ZIP
RHIDE14B.ZIP    MAK3761B.ZIP    TXI390B.ZIP     RSXDJ131.ZIP

They all unzipped successfully into the following directory structure
(D drive is my PC harddisk):

Directory of D:\djgpp

[.]             [..]            [BIN]           [GNU]           [INFO]        
[MANIFEST]      DJGPP.ENV       [INCLUDE]       [LIB]           [TMP]        
[ZONEINFO]      [SHARE]         [CONTRIB]       [DOC]           README.1ST  
COPYING.DJ      [FAQ]            

I run setdjgpp using the following command:

setdjgpp d:\djgpp d:/djgpp

I have checked that both djgpp and library_path are defined:

echo %library_path%  gives  d:\djgpp\lib
echo %djgpp%        gives  d:\djgpp\djgpp.env

Also, PATH has d:\djgpp\bin

When I tried to compile a c program such as:

gcc filename.c

I got the following two error messages:

No include path in which to find stdio.h
No include path in which to find stdlib.h

Have I missed out anything?  BTW I have read the readme.1st and the FAQ,
but cannot figure out what else do I need to do.

I am running djgpp in a MSDOS window under Window95.  I am using a PC with
pentium 200MHz processor and 32M memory.

Thank you for any assistance.

Daniel

 
 
 

Help: Newbie can't compile a ' Hello world' program

Post by Charles Terr » Thu, 09 Apr 1998 04:00:00



> I am a newbie to djgpp. I need some help to compile my first c program.
> I outline below what I have done up till today.

> I have downloaded the following zip files:

> BNU281B.ZIP     GCC280B.ZIP     FAQ210B.ZIP     DJDEV201.ZIP
> RHIDE14B.ZIP    MAK3761B.ZIP    TXI390B.ZIP     RSXDJ131.ZIP

> They all unzipped successfully into the following directory structure
> (D drive is my PC harddisk):

> Directory of D:\djgpp

> [.]             [..]            [BIN]           [GNU]           [INFO]
> [MANIFEST]      DJGPP.ENV       [INCLUDE]       [LIB]           [TMP]
> [ZONEINFO]      [SHARE]         [CONTRIB]       [DOC]           README.1ST
> COPYING.DJ      [FAQ]

> I run setdjgpp using the following command:

> setdjgpp d:\djgpp d:/djgpp

> I have checked that both djgpp and library_path are defined:

> echo %library_path%  gives  d:\djgpp\lib
> echo %djgpp%        gives  d:\djgpp\djgpp.env

> Also, PATH has d:\djgpp\bin

> When I tried to compile a c program such as:

> gcc filename.c

> I got the following two error messages:

> No include path in which to find stdio.h
> No include path in which to find stdlib.h

> Have I missed out anything?  BTW I have read the readme.1st and the FAQ,
> but cannot figure out what else do I need to do.

> I am running djgpp in a MSDOS window under Window95.  I am using a PC with
> pentium 200MHz processor and 32M memory.

> Thank you for any assistance.

> Daniel

I'm probably not the best qualified to respond as I don't run
win95 but as I seem to be the quickest I'll try to help.

Try running

Quote:> gcc -Id:\djgpp\include filename.c

If that works but gives an error about crt0.o not being found
then dj is not finding the djgpp.env file.
the > setdjgpp d:\djgpp d:/djgpp command you used above is
unfamiliar to me- is it a batch file?
I used
set DJGPP=d:\djgpp\djgpp.env
in my autoexec.bat file and it works fine.

If this doen't work I'm sure the cavelry is on the way.

Charles Terry

 
 
 

Help: Newbie can't compile a ' Hello world' program

Post by John M. Aldric » Thu, 09 Apr 1998 04:00:00



> When I tried to compile a c program such as:

> gcc filename.c

> I got the following two error messages:

> No include path in which to find stdio.h
> No include path in which to find stdlib.h

> Have I missed out anything?  BTW I have read the readme.1st and the FAQ,
> but cannot figure out what else do I need to do.

Your installation looks okay to me, but I do not recognize those two
error messages.  I'm not even sure that they come from DJGPP.  Are you
certain that you don't have any programs from a different compiler (like
Borland or Turbo C) somewhere on your PATH before the DJGPP 'bin'
directory?  If so, those will get called instead of the DJGPP programs,
causing no end of trouble.

If this doesn't help, you may want to try out my DJVERIFY installation
diagnostic utility.  It's not quite ready for release yet but you can
help me test the latest version, which is downloadable from my web site
(http://www.cs.com/fighteer/).

hth!

--

* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
  causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
  again.
* It doesn't necessarily do it in chronological order, though.

                                       --- Douglas Adams

 
 
 

1. Compiling WinAllegro Example No1. 'Hello World'

Im trying to compile the WinAllegro Example No1. using DJGPP with
RSXNTDJ.

This is the compile line i use & what is returned:

C:\djgpp\BIN>gcc -Zwin32 -Zmt -lwinal c:\1\1.c -o c:\1\1.exe
Ntbind: Building GUI Application "c:\1\1.exe"

All seems ok until i try running 1.exe then i get a MsgBox titled
RSXNT saying:

Exception at 0x00000000
Application got signal SIGSEGV

Anyone know how to fix this?
Thanx.

2. Recursion

3. 'Hello world' problem

4. Large-scale email solutions?

5. can't compile c++ "hello world"

6. PMMail 1.53 Bug Alert

7. Can't compile Hello World!!!

8. PilotMirror and Handstamp for free?

9. hello world program doesn't work

10. I can't seem to link a "hello world" program in DJGPP v2

11. Typing '{', '}', '[', ']' etc on german keyboard

12. help!-again-can't compile c-files in directory 'Test'

13. Hello world isn't working :(