Re: GCC: Compilation using C/C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 17, 2008 at 11:07 PM, Ricardo Sardano Guanciale
<ricardo.guanciale@xxxxxxxxxxx> wrote:
> My name is Ricardo, please can you help me?
...
>  #include <iostream>
>
>  void main(void)
>  {
>      cout << "Hello world!\n";
>  }
>
>  gcc helloworld.cpp -o helloworld
>
>  The compiler answered:
...

>  helloworld.cpp:4: error: `main' must return `int'

Same as C, "int main()".

>  helloworld.cpp: In function `int main(...)':

You can use "std::cout" or "using namespace std;" before the first use
of "cout".

-Tom

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux