delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/13/00:21:45

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP!! DJGPP WON'T WORK!
Date: Sun, 12 Oct 1997 23:19:02 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 103
Message-ID: <34415AE6.4CFA@cs.com>
References: <34410249 DOT 2D03 AT swbell DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp230.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

quintero AT swbell DOT net wrote:
> 
> Hello DJGPP users,
> I have a serious problem.  I downloaded all the necessary files for
> DJGPP and downloaded RHIDE 1.3c as well.  Everytime I use DJGPP under
> DOS, it won't compile my programs (not even the simple hello.cc).  It
> always gives me errors about the <iostream.h> and a couple others like
> e:/dj/bin/ld.exe can't find crt0.o.  I don't understand it! I have
> everything in my paths
> (path=c:\dos;c:\pcci5(antivirus);d:\;e:\dj\bin;e:\)
> and the autoexec.bat and config.sys is configured to the way the FAQ
> told me.  

If you've read the FAQ, you'll probably have noticed chapter 6.12, which
gives instructions for what to do when you can't solve your problems on
your own.  It says that you need to include your config.sys,
autoexec.bat, djgpp.env, and environment settings for us to be able to
help.  Without that, the best I can do is guess at your problem.

It looks like you may not have set the "DJGPP" environment variable
properly.  Assuming that you put your DJGPP distribution in e:\dj, then
this is the proper setting:

    set DJGPP=e:/dj/djgpp.env

Make sure this is in your autoexec.bat, and make sure that it is
actually in the environment after you boot (type "set" from the DOS
prompt).

Second, did you actually install the C++ files?  If not, then you need
to get 'gpp2721b.zip' and 'lgp271b.zip' from the SimTel archives.

Third, when compiling C++ programs, you must link the C++ libraries. 
Either add "-lgpp" to the end of your command line, or use 'gxx' instead
of 'gcc'.  In RHIDE, make sure that the C++ libraries are checked in the
Options|Libraries menu, and that you are naming your program with a
valid C++ name (.cc, .cpp, and .C (but not .c) are all valid
extensions).

If all else fails, please create a full system report as outlined in
chapter 6.12 of the FAQ and send it to us.

> Here's a sample problem program that I have tried in vain to
> compile:
> /* Cheap program... */
> 
> #include<iostream.h>

You should put a space between #include and <iostream.h>.  I don't know
if this really matters, but it's good style.

> int main()
> {
> clrscr();       // it also gives me : Warning: Implicit use of clrscr(..)

Of course it does.  clrscr() is declared in <conio.h>.  If you get
warnings about implicit function declarations, look them up in the libc
docs to see what header they belong to.

> cout<<"If this does not work, I am throwing my computer";
> cout<<" Out the window!!"<<'\n'; // I am but a novice C++ programmer. :(
> return 0;
> }
> 
> also, I can't compile Allegro 2.2 using the makefile.  It gives me an
> error about "can't make use (something like that) of 'Badtarget'"
> I really need help on this! Many thanks to all who help me!

Please use the 'redir' utility to capture the output of Make and send it
to us, or else copy the exact error message that you got.  In any case,
Allegro should compile out of the box if your environment is set up
correctly.

> P.S. attached is a 3d line program that one of my freinds gave me to
> test out my paths:k2.cpp.

While hardly relevant to the problem, this program compiles and runs
flawlessly on my machine.  Some notes during compilation:

D:\CPROGS>gxx -Wall -O -g -o k2.exe k2.cpp
k2.cpp:268: warning: return type for `main' changed to integer type
k2.cpp: In function `int main(...)':
k2.cpp:277: warning: implicit declaration of function `int malloc(...)'
k2.cpp:270: warning: unused variable `unsigned int count'
k2.cpp: In function `void key_handler()':
k2.cpp:469: warning: unused variable `unsigned char ah'
k2.cpp: In function `void clear(char *, char)':
k2.cpp:556: warning: implicit declaration of function `int memset(...)'

These warnings indicate bad coding style.  main() must return an
integer.  malloc() is declared in <stdlib.h>.  memset() is declared in
<string.h>.  And there are two unused variables.  Other than that, it's
fine.

hth

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Waking a person unnecessarily       |
|       aka Fighteer I       | should not be considered a capital   |
|   mailto:fighteer AT cs DOT com   | crime.  For a first offense, that    |
| http://www.cs.com/fighteer | is."            - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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