Bug#105238: g++-3.0 fails to find system headers when -I/usr/include is used
Package: g++-3.0
Version: 3.0-4
Hello,
This bug report may need to be redirected to a different package
(cpp-3.0 or libstdc++3-dev).
Adding "-I/usr/include" to the compile line of g++-3.0 can cause
system headers in /usr/include to *not* be found. This is due to the
use of #include_next inside /usr/include/g++-v3/bits headers. This
directive causes the CPP to check for the file in any directories
after the current one in the list. Explicitly adding -I/usr/include
evidently removes it from the list of internal directories to check.
The following code will trigger this problem:
bviren@minos:bviren> cat blah.cc
#include <iosfwd>
int main (int argc, char *argv[])
{
return 0;
} // end of main()
In the next 4 commands, the first 3 succeed, the last fails:
bviren@minos:bviren> g++-2.95 blah.cc
bviren@minos:bviren> g++-2.95 -I/usr/include blah.cc
bviren@minos:bviren> g++-3.0 blah.cc
bviren@minos:bviren> g++-3.0 -I/usr/include blah.cc
In file included from /usr/include/g++-v3/bits/fpos.h:40,
from /usr/include/g++-v3/bits/std_iosfwd.h:41,
from /usr/include/g++-v3/iosfwd:31,
from blah.cc:1:
/usr/include/g++-v3/bits/std_cwchar.h:42:24: wchar.h: No such file or directory
In file included from /usr/include/g++-v3/bits/fpos.h:40,
from /usr/include/g++-v3/bits/std_iosfwd.h:41,
from /usr/include/g++-v3/iosfwd:31,
from blah.cc:1:
/usr/include/g++-v3/bits/std_cwchar.h:59: `mbstate_t' not declared
/usr/include/g++-v3/bits/std_cwchar.h:125: `btowc' not declared
/usr/include/g++-v3/bits/std_cwchar.h:126: `fgetwc' not declared
/usr/include/g++-v3/bits/std_cwchar.h:127: `fgetws' not declared
/usr/include/g++-v3/bits/std_cwchar.h:128: `fputwc' not declared
/usr/include/g++-v3/bits/std_cwchar.h:129: `fputws' not declared
/usr/include/g++-v3/bits/std_cwchar.h:130: `fwide' not declared
/usr/include/g++-v3/bits/std_cwchar.h:131: `fwprintf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:132: `fwscanf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:133: `getwc' not declared
/usr/include/g++-v3/bits/std_cwchar.h:134: `getwchar' not declared
/usr/include/g++-v3/bits/std_cwchar.h:135: `mbrlen' not declared
/usr/include/g++-v3/bits/std_cwchar.h:136: `mbrtowc' not declared
/usr/include/g++-v3/bits/std_cwchar.h:137: `mbsinit' not declared
/usr/include/g++-v3/bits/std_cwchar.h:138: `mbsrtowcs' not declared
/usr/include/g++-v3/bits/std_cwchar.h:139: `putwc' not declared
/usr/include/g++-v3/bits/std_cwchar.h:140: `putwchar' not declared
/usr/include/g++-v3/bits/std_cwchar.h:141: `swprintf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:142: `swscanf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:143: `ungetwc' not declared
/usr/include/g++-v3/bits/std_cwchar.h:144: `vfwprintf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:145: `vfwscanf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:146: `vswprintf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:147: `vswscanf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:148: `vwprintf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:149: `vwscanf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:150: `wcrtomb' not declared
/usr/include/g++-v3/bits/std_cwchar.h:151: `wcscat' not declared
/usr/include/g++-v3/bits/std_cwchar.h:152: `wcscmp' not declared
/usr/include/g++-v3/bits/std_cwchar.h:153: `wcscoll' not declared
/usr/include/g++-v3/bits/std_cwchar.h:154: `wcscpy' not declared
/usr/include/g++-v3/bits/std_cwchar.h:155: `wcscspn' not declared
/usr/include/g++-v3/bits/std_cwchar.h:156: `wcsftime' not declared
/usr/include/g++-v3/bits/std_cwchar.h:157: `wcslen' not declared
/usr/include/g++-v3/bits/std_cwchar.h:158: `wcsncat' not declared
/usr/include/g++-v3/bits/std_cwchar.h:159: `wcsncmp' not declared
/usr/include/g++-v3/bits/std_cwchar.h:160: `wcsncpy' not declared
/usr/include/g++-v3/bits/std_cwchar.h:161: `wcsrtombs' not declared
/usr/include/g++-v3/bits/std_cwchar.h:162: `wcsspn' not declared
/usr/include/g++-v3/bits/std_cwchar.h:163: `wcstod' not declared
/usr/include/g++-v3/bits/std_cwchar.h:164: `wcstof' not declared
/usr/include/g++-v3/bits/std_cwchar.h:165: `wcstok' not declared
/usr/include/g++-v3/bits/std_cwchar.h:166: `wcstol' not declared
/usr/include/g++-v3/bits/std_cwchar.h:167: `wcstoul' not declared
/usr/include/g++-v3/bits/std_cwchar.h:168: `wcsxfrm' not declared
/usr/include/g++-v3/bits/std_cwchar.h:169: `wctob' not declared
/usr/include/g++-v3/bits/std_cwchar.h:170: `wmemcmp' not declared
/usr/include/g++-v3/bits/std_cwchar.h:171: `wmemcpy' not declared
/usr/include/g++-v3/bits/std_cwchar.h:172: `wmemmove' not declared
/usr/include/g++-v3/bits/std_cwchar.h:173: `wmemset' not declared
/usr/include/g++-v3/bits/std_cwchar.h:174: `wprintf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:175: `wscanf' not declared
/usr/include/g++-v3/bits/std_cwchar.h:177: `wcschr' not declared
/usr/include/g++-v3/bits/std_cwchar.h: In function `wchar_t*
std::wcschr(wchar_t*, wchar_t)':
/usr/include/g++-v3/bits/std_cwchar.h:181: cannot convert `const wchar_t*' to
`wchar_t*' for argument `1' to `wchar_t* std::wcschr(wchar_t*, wchar_t)'
/usr/include/g++-v3/bits/std_cwchar.h: At global scope:
/usr/include/g++-v3/bits/std_cwchar.h:183: `wcspbrk' not declared
/usr/include/g++-v3/bits/std_cwchar.h: In function `wchar_t*
std::wcspbrk(wchar_t*, wchar_t*)':
/usr/include/g++-v3/bits/std_cwchar.h:187: cannot convert `const wchar_t*' to
`wchar_t*' for argument `1' to `wchar_t* std::wcspbrk(wchar_t*, wchar_t*)'
/usr/include/g++-v3/bits/std_cwchar.h: At global scope:
/usr/include/g++-v3/bits/std_cwchar.h:189: `wcsrchr' not declared
/usr/include/g++-v3/bits/std_cwchar.h: In function `wchar_t*
std::wcsrchr(wchar_t*, wchar_t)':
/usr/include/g++-v3/bits/std_cwchar.h:193: cannot convert `const wchar_t*' to
`wchar_t*' for argument `1' to `wchar_t* std::wcsrchr(wchar_t*, wchar_t)'
/usr/include/g++-v3/bits/std_cwchar.h: At global scope:
/usr/include/g++-v3/bits/std_cwchar.h:195: `wcsstr' not declared
/usr/include/g++-v3/bits/std_cwchar.h: In function `wchar_t*
std::wcsstr(wchar_t*, wchar_t*)':
/usr/include/g++-v3/bits/std_cwchar.h:199: cannot convert `const wchar_t*' to
`wchar_t*' for argument `1' to `wchar_t* std::wcsstr(wchar_t*, wchar_t*)'
/usr/include/g++-v3/bits/std_cwchar.h: At global scope:
/usr/include/g++-v3/bits/std_cwchar.h:201: `wmemchr' not declared
/usr/include/g++-v3/bits/std_cwchar.h: In function `wchar_t*
std::wmemchr(wchar_t*, wchar_t, unsigned int)':
/usr/include/g++-v3/bits/std_cwchar.h:205: cannot convert `const wchar_t*' to
`wchar_t*' for argument `1' to `wchar_t* std::wmemchr(wchar_t*, wchar_t,
unsigned int)'
/usr/include/g++-v3/bits/std_cwchar.h: At global scope:
/usr/include/g++-v3/bits/std_cwchar.h:216: `wcstold' not declared
/usr/include/g++-v3/bits/std_cwchar.h:217: `wcstoll' not declared
/usr/include/g++-v3/bits/std_cwchar.h:218: `wcstoull' not declared
/usr/include/g++-v3/bits/std_cwchar.h:223: `wcstold' not declared
/usr/include/g++-v3/bits/std_cwchar.h:224: `wcstoll' not declared
/usr/include/g++-v3/bits/std_cwchar.h:225: `wcstoull' not declared
In file included from /usr/include/g++-v3/bits/std_iosfwd.h:41,
from /usr/include/g++-v3/iosfwd:31,
from blah.cc:1:
/usr/include/g++-v3/bits/fpos.h:112: `mbstate_t' was not declared in this scope
/usr/include/g++-v3/bits/fpos.h:112: template argument 1 is invalid
/usr/include/g++-v3/bits/fpos.h:114: `mbstate_t' was not declared in this scope
/usr/include/g++-v3/bits/fpos.h:114: template argument 1 is invalid
bviren@minos:bviren> dpkg -l libgcc1 libc6 gcc-3.0 libstdc++3-dev
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii libgcc1 3.0-4 GCC support library.
ii libc6 2.2.3-1 GNU C Library: Shared libraries and Timezone
ii gcc-3.0 3.0-4 The GNU C compiler.
ii libstdc++3-dev 3.0-4 The GNU stdc++ library version 3 (developmen
bviren@minos:bviren> uname -a
Linux minos 2.4.2 #4 SMP Tue Mar 20 10:49:23 EST 2001 i686 unknown
-Brett.
-Brett
Reply to: