This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: Trying to compile a simple C++ program
- To: cygwin at cygwin dot com
- Subject: Re: Trying to compile a simple C++ program
- From: Dan Plimak <danp at systematik dot co dot nz>
- Date: Mon, 12 Feb 2001 22:57:17 +1300
- References: <001201c0940b$08c8c3a0$ac07f8d4@1>
On Sun, Feb 11, 2001 at 12:13:11PM +0300, Anton Mochalin wrote:
> Hello.
>
> I typed a simple program into a file 'a.cpp':
>
> #include <iostream.h>
>
> main()
> {
> cout << "Hi!";
> }
>
> and then tried to compile it:
> $ gcc -o a.exe a.cpp
>
You'll be wanting to add -lstdc++ to the command line, as in:
$ gcc -lstdc++ a.exe a.cpp
Oh, and the .cpp extension is nonstandard in the GNU world -- use .cxx or
.cc.
-- danp
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple