Errors when including wchar.h, wctype.h and iostream

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

 



Hi all,

Any idea on why the following code fails to compile?

Changing the order of include directives or removing one of them solves the 
problem.

Is this a bug?

Thanks!

BEGIN_SESSION
yb@chroot:~> cat include.cpp 
#include <wchar.h>
#include <wctype.h>
#include <iostream>

main() {}
yb@chroot:~> g++ include.cpp 
In file included from /usr/include/c++/4.3/cwchar:49,
                 from /usr/include/c++/4.3/bits/postypes.h:47,
                 from /usr/include/c++/4.3/iosfwd:47,
                 from /usr/include/c++/4.3/ios:44,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from include.cpp:3:
/usr/include/c++/4.3/cstddef:55: error: ‘::ptrdiff_t’ has not been declared
In file included from /usr/include/c++/4.3/iosfwd:47,
                 from /usr/include/c++/4.3/ios:44,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from include.cpp:3:
/usr/include/c++/4.3/bits/postypes.h:77: error: ‘ptrdiff_t’ does not name a 
type
In file included 
from /usr/include/c++/4.3/i486-linux-gnu/bits/c++allocator.h:39,
                 from /usr/include/c++/4.3/bits/allocator.h:53,
                 from /usr/include/c++/4.3/string:48,
                 from /usr/include/c++/4.3/bits/locale_classes.h:47,
                 from /usr/include/c++/4.3/bits/ios_base.h:48,
                 from /usr/include/c++/4.3/ios:48,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from include.cpp:3:
/usr/include/c++/4.3/ext/new_allocator.h:44: error: ‘std::ptrdiff_t’ has not 
been declared ...
END_SESSION


[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