From: Greg C. <chi...@mi...> - 2003-11-26 04:09:05
|
Peter Barada wrote: > [georgebezerra wrote:] > >The main problem is the command "cout" that does not belong to the C > >language, but to the C++ one. Therefore, I think I cannot use the > >same basic command line: gcc -o hello.exe hello.c, that I used to use > >on C programs. > > Try renaming hello.c to hello.cc, that way GCC will think its a C++ > program. Then it would compile OK, but wouldn't link. The easiest way is to use 'g++' instead. That links the right libraries for C++ automatically. |