This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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

Re: first program


I tried exactly the same as what you did, but I got the hello message.
try put endl at the end of cout statement.. to make sure it flush out
the message
cout << "hello" << endl;

hope this help.
In article <Lhm_3.14$ES2.1534@nnrp1.ptd.net>,
  "Will Elmes" <welmes@ptd.net> wrote:
> this is my first attempt at compiling and running a program under
linux.
> this doesn't make sense but when i attempt to run it absolutely
nothing
> happens.
>
> #include <iostream.h>
> int main(void)
>     {
>     cout << "hello!!";
>     }
>
> then to compile:
>     $g++ -Wall -c hello.cpp
>
> then to link(i think i need to do this?>?):
>     $g++ hello.o -o hello
>
> then to execute:
>     $hello
>
> i get nothing.....any help for a newbie would be appreciated.
>
> thanks!!
>
> welmes@ptd.net
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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