Re: in g++(invalid use of incomplete type)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux