[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: newbie question
From: |
Thomas Maeder |
Subject: |
Re: newbie question |
Date: |
Sun, 22 Aug 2004 19:18:25 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) |
firegun9@yahoo.com.tw (Joe) writes:
> #include <iostream>
Note that you also have to #include <ostream> to make sure that your program
portably behaves as you expect.
> using namespace std;
>
> int main()
> {
> cout << "Hello";
> return (0);
> }
>
>
> Then back to the console, I type "g++ test.cpp -o test".
> Fortunately, I got no errors and a file "test.exe" in the same directory.
>
> But I got a problem here.
> When I type "test" or "test.exe" to execute that program, nothing happened.
> There isn't any error or message, just like it is an empty program.
>
> Am I doing wrong somewhere??
Yes. cygwin-wise, not C++-wise. The current directory is obviously not in
the PATH, so you have to do something like
./test.exe