This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: in g++(invalid use of incomplete type)
Hi eric,
On Sun, Jul 10, 2011 at 11:32:56PM -0700, eric wrote:
> Dear c++ programers:
>
> If you are also an g++ programers, especially ever create/modify its
> source code, I need your help
> I have a piece simple code about formatting a date/time as a string
> from a book. its authors claim it work in vc++7.1 on xp.
> but my g++4.5.2 didn't pass it on compile stage
> -------------------------------------------------------------------------------------------
> eric@eric-laptop:~/cppcookbook/ch5$ g++ Example5-4.cpp
> Example5-4.cpp: In function âstd::ostream&
> formatDatetime(std::ostream&, const tm&, const char*)â:
> Example5-4.cpp:16:17: error: invalid use of incomplete type âconst
> struct std::time_put<char>â
I assume it's the same problem as with most of your examples: this
is probably no valid C++ code. You use the class std::time_put in file
Example5-4.cpp, line 16. But in the headers you include, this class is
only forward declared, but not defined ==> the compiler can't continue.
Did you really include <locale> ?
Axel