delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/03/01:08:24

Date: Mon, 3 Feb 1997 00:52:42 -0500 (EST)
From: Michael Phelps <morphine AT hops DOT cs DOT jhu DOT edu>
To: Deez Nutz <mceeras AT akula DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: "HELLO WORLD!" C++ Programming Error with Djgpp?
In-Reply-To: <32f55207.1140784@news.akula.com>
Message-ID: <Pine.GSO.3.95.970203005131.1832A-100000@hops.cs.jhu.edu>
MIME-Version: 1.0

On Mon, 3 Feb 1997, Deez Nutz wrote:

> I am starting on learning C++ using DJGPP and I am having problems.  I
> have downloaded the lgp and gpp files for C++ and I have had previous
> success in running simple programs like "Hello World!" In C
> previously.  However, In reading a book entitled "C++ Programming 101"
> by Sams Publishing, I have not been succesful in do such simple
> programs in c++:
> 
> This is the following C++ syntax that I type:
> 
> // Filename hello.cpp Displays Message
> #include<iostream.h>
> void main()

it's best to use int main()

> {
> 	cout << "Hello World!";
> }
> 
> I then compile as so:
> 
> C:\>gcc hello.cpp -o hello
> 

Use gxx hello.cpp -o hello.exe
instead.  (Compile with gxx whenever you use C++ and it will automatically
take care of the "undefined reference to 'cout'" error messages and such.)

> 
> I then get an error regarding the main function. I cant recall what
> exactly the error is but If someone can help I would appreciate it.
> Thank You.
> 
> 
> 


						---Michael Phelps
						   morphine AT cs DOT jhu DOT edu


                               CH3
                               |
                               N
                             / |
                     ______/   |
                    /      \   CH2
             _____/         \__|__      
           //     \\        /  |  \\     
         //        \\______/___CH2 \\  
          \        /       \       /
           \______/         \_____/
          / ------ \       /      \
        OH           \   /         OH
                       O
 
                   Morphine



- Raw text -


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