This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Trying to compile a simple C++ program


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]