Menu

#16 iostream manipulators problem

closed
None
5
2002-08-05
2002-07-25
No

I have a simple but frustrating problem using MinGW
with DEV-C++. I have ported some code which
compiles with no problem on BC55++. I am using
the latest download of DEV-C++ v4.9.4.1.

This code fails with the error
"`left' undeclared (first use this function)":

cout << left << "Hello";

If I replace this line with the following two lines the
code compiles and works:

cout.setf(ios::left);
cout << "Hello";

Note that I include <iostream> and <iomanip>.

Why do the 'left' or 'right' manipulators fail and how
can I fix it?

Thanks,
David

Discussion

  • Luke Dunstan

    Luke Dunstan - 2002-07-26

    Logged In: YES
    user_id=30442

    This manipulator simply was not supported in the version of
    libstdc++ included with gcc 2.95.x. This has been fixed in
    gcc 3.1.

     
  • David Armour

    David Armour - 2002-07-26

    Logged In: YES
    user_id=580773

    I discovered this yesterday and installed GCC3.1 to
    run with my DEV-C++ v4.9.4.1

    It works fine now.

    Thanks for taking the time to respond.

    Regards.

     
  • Earnie Boyd

    Earnie Boyd - 2002-08-05

    Logged In: YES
    user_id=15438

    Resolution found. - Closed.

     
  • Earnie Boyd

    Earnie Boyd - 2002-08-05
    • assigned_to: nobody --> earnie
    • status: open --> closed