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

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

 



On 11 July 2011 07:32, 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

You need to learn to solve these problems yourself, or you're not
learning anything.

> -------------------------------------------------------------------------------------------
> 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>’

The compiler tells you the type "time_put" is not defined, so you
probably haven't included the header that defines it.

Look at any reference (e.g.
http://dinkumware.com/manuals/default.aspx?manual=compleat&page=locale2.html#time_put
or http://cplusplus.com/reference/std/locale/time_put/) and you'll
find you need to #include <locale>



[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