Mail Archives: djgpp/2001/02/05/20:41:36
| From:  | Steve Offutt <indmold AT oz DOT sunflower DOT org>
 | 
| Newsgroups:  | comp.os.msdos.djgpp
 | 
| Subject:  | Re: won't run my program
 | 
| Date:  | Tue, 06 Feb 2001 01:19:26 GMT
 | 
| Organization:  | Deja.com
 | 
| Lines:  | 63
 | 
| Message-ID:  | <95njen$v12$1@nnrp1.deja.com>
 | 
| References:  | <3a7de922 AT leia DOT ktsnet DOT com>
 | 
| NNTP-Posting-Host:  | 209.16.214.112
 | 
| X-Article-Creation-Date:  | Tue Feb 06 01:19:26 2001 GMT
 | 
| X-Http-User-Agent:  | Mozilla/4.7 [en] (Win98; I)
 | 
| X-Http-Proxy:  | 1.0 x70.deja.com:80 (Squid/1.1.22) for client 209.16.214.112
 | 
| X-MyDeja-Info:  | XMYDJUIDsteveo84
 | 
| To:  | djgpp AT delorie DOT com
 | 
| DJ-Gateway:  | from newsgroup comp.os.msdos.djgpp
 | 
| Reply-To:  | djgpp AT delorie DOT com
 | 
In article <3a7de922 AT leia DOT ktsnet DOT com>,
  "Cody" <cody1 AT ktsnet DOT com> wrote:
> I have been using the djgpp compiler for quite a while now with
absolutely
> no complaints... it's free and has a great graphics library (allegro)
and
> suits my needs perfectly.  I also use Rhide as my ide.  It has worked
fine
> for months, but yesterday when I went to compile a simple program, it
> wouldn't let me do it.  I went to alt-r and run, yet run was not black
 and
> it wouldn't let me choose that option.  I have no clue as to why this
is
> happening.  It won't even compile my stupid programs.  Under the
compile
> tab, make link and build all are all grayed out, just like run is.  I
have
> tried to solve the problem myself, but to no avail.  I reinstalled
Rhide,
> but that didn't help any.  Does anyone know what could be the problem?
 Here
> is a posting of the simple code that I was trying to compile:
>
> #include <conio.h>
> #include <fstream.h>
> void main(void) {
> clrscr();
> cout<<"this is my program"<<endl;
> getch();
> }
>
>
Try to compile the following:
----
 #include <conio.h>
 // #include <fstream.h> why? unnecessary
 #include <iostream.h> //you need this one
 //void main(void) { nit-pick main retruns an integer
 int main ( ) {
	 clrscr();
 	cout<<"this is my program"<<endl;
 	getch(); //why? just to get the pause?
	return 0; //same as above, main returns int
 }
----
It this doesnt compile and run, I suspect you have
broken your install.
HTH
Steve
--
Steve Offutt
*Learning* to program is my hobby
Sent via Deja.com
http://www.deja.com/
- Raw text -