Mail Archives: djgpp/1997/02/03/01:08:24
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 -