cout is declared in namespace std, so either bring it to global namespace by "using" directive or use explicit qualification:
--snip-- #include <iostream> using namespace std; int main() { cout << "Test\n"; return 0; } --snip-- Or --snip-- #include <iostream> int main() { std::cout << "Test\n"; return 0; } --snip-- should compile fine On 6/16/06, Steve Bby <[EMAIL PROTECTED]> wrote:
I compile a small program below: ******************** #include <iostream> main() { cout << "Test\n"; } ******************** GOT ERROR: ===================== $ g++ -o bmain bmain.c bmain.c: In function `int main()': bmain.c:5: error: `cout' undeclared (first use this function) bmain.c:5: error: (Each undeclared identifier is reported only once for each function it appears in.) $ What's wrong. Help please! _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus
-- Regards, V i p i n Life is what happens to you while you are busy making other plans. - John Lenon _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus