Bug 603554 - G++ fails to load standard C++ headers
Summary: G++ fails to load standard C++ headers
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 13
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-13 19:56 UTC by Giovanni Campagna
Modified: 2010-06-13 20:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-13 20:20:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output from G++ (second example) (551 bytes, text/plain)
2010-06-13 19:56 UTC, Giovanni Campagna
no flags Details

Description Giovanni Campagna 2010-06-13 19:56:37 UTC
Created attachment 423687 [details]
Output from G++ (second example)

Description of problem:
Standard headers like <exception> or <vector> are not loadable, thus all code depending on them fails to compile.

Version-Release number of selected component (if applicable):
4.4.4-2.fc12

How reproducible:
$ echo "
#include <exception>
                 
int main() { return 42; }" | g++ -x c++ -

results in:
In file included from <stdin>:2:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/exception:37:28: error: bits/c++config.h: No such file or directory
In file included from <stdin>:2:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/exception:120: error: expected constructor, destructor, or type conversion before ‘(’ token
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/exception:142: error: expected constructor, destructor, or type conversion before ‘}’ token

$ echo "
#include <exception>

int main() { return 42; }" | g++ -x c++ -

results in a long sequence of errors (included as attachment)

Comment 1 Giovanni Campagna 2010-06-13 20:04:42 UTC
Sorry the second one had #include <vector>

Plus, I found out that, even though gcc-c++.x86_64 exists
/usr/include/i686-redhat-linux exists but not /usr/include/x86_64-redhat-linux

Comment 2 Jakub Jelinek 2010-06-13 20:20:42 UTC
That means you've installed libstdc++-devel.i686 and not libstdc++-devel.x86_64.
You need to former to compile 32-bit programs (i.e. g++ -m32), while the latter for 64-bit programs.

Comment 3 Giovanni Campagna 2010-06-13 20:38:40 UTC
Well, gcc-c++ should depend on libstdc++-devel of the appropriate architecture. as it is mostly useless on its own.

Thanks anyway.


Note You need to log in before you can comment on or make changes to this bug.