Trying to compile a simple C++ program

Dan Plimak danp@systematik.co.nz
Sun Feb 11 02:05:00 GMT 2001


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



More information about the Cygwin mailing list