Public bug reported:

Having a look at step 1 of "Using the Standard C++ Library", at :
http://gcc.gnu.org/onlinedocs/gcc-4.7.1/libstdc++/manual/manual/using_headers.html
it says:
<quote>
Precompiled Headers

There are three base header files that are provided. They can be used to
precompile the standard headers and extensions into binary files that
may the be used to speed compiles that use these headers.

    stdc++.h

    Includes all standard headers. Actual content varies depending on language 
dialect. 
</quote>

So, on Ubuntu 12.04, with gcc-4.6-multilib (4:4.6.3-1ubuntu5) installed on an 
x86_64 ,
I do:

  $ echo '#include <stdc++.h>' > t.cpp
  $ g++ -c t.cpp

$ g++ -c t.cpp
t.cpp:1:20: fatal error: stdc++.h: No such file or directory
compilation terminated.

So one cannot use the standard documentation for the standard C++
library with your distribution .

Evidently g++ is invoking cpp without these directories being searched :

$ find /usr/include -name 'stdc\+\+\.h'
/usr/include/c++/4.6/x86_64-linux-gnu/bits/stdc++.h
/usr/include/c++/4.6/x86_64-linux-gnu/32/bits/stdc++.h

Even though cpp purports to be searching them :

$ cpp -print-search-dirs
install: /usr/lib/gcc/x86_64-linux-gnu/4.6/
programs: 
=/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/
libraries: 
=/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/:/lib/x86_64-linux-gnu/4.6/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/4.6/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../:/lib/:/usr/lib/


$ g++ --version; cpp --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cpp (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Please rectify - or do I have an installation problem ? 

This machine was set up by my company IT and should have been installed from 
latest Ubuntu DVD a couple of weeks ago -
it is saying all packages are updated to latest versions.

** Affects: gcc-4.6 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1023401

Title:
  gcc-4.6.3 's c++ command cannot locate "stdc++.h" in standard include
  path

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1023401/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to