This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

std::ofstream


I am using gcc-3.0 and the following fails to
compile, which I believe should be OK. I
lifted the line in question from page 632 of
Josuttis.

#include <iostream>

int main()
{
        std::ofstream file("xyz.out", std::ios::out|std::ios::app);
}

The errors from the compiler were:

g++     foobar.cc   -o foobar
foobar.cc: In function `int main()':
foobar.cc:5: variable `std::ofstream file' has initializer but
incomplete type
make: *** [foobar] Error 1

Am I in error somewhere?

Thanks.

Dean Hoover


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