clang doesn't find stdc++ headers

Bug #1154729 reported by Giulio Collura
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
clang (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When i try to run a simple c++ program like:
#include <iostream>
int main() {
std::cout << "HelloWorld" << std::endl;
return 0;

This is the verbose output:
$ clang++ test.cpp -o test -v
Ubuntu clang version 3.2-1~exp5ubuntu2 (tags/RELEASE_32/final) (based on LLVM 3.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
 "/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name lambda.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.23.1 -momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/3.2 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.2/include -internal-isystem /usr/include/clang/3.2/include/ -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/random/Projects/Tests -ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/lambda-3jYJtR.o -x c++ lambda.cpp
clang -cc1 version 3.2 based upon LLVM 3.2svn default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/include/c++/v1"
ignoring nonexistent directory "/usr/bin/../lib/clang/3.2/include"
ignoring duplicate directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include/clang/3.2/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
lambda.cpp:2:10: fatal error: 'iostream' file not found
#include <iostream>
         ^
1 error generated.

I'm currently running raring amd64.
Packages:
clang:
  Installed: 3.2-1~exp5ubuntu2
  Candidate: 3.2-1~exp5ubuntu2
  Version table:
 *** 3.2-1~exp5ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages
        100 /var/lib/dpkg/status

llvm-3.2:
  Installed: 3.2-2ubuntu4
  Candidate: 3.2-2ubuntu4
  Version table:
 *** 3.2-2ubuntu4 0
        500 http://archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages
        100 /var/lib/dpkg/status

gcc:
  Installed: 4:4.7.2-1ubuntu8
  Candidate: 4:4.7.2-1ubuntu8
  Version table:
 *** 4:4.7.2-1ubuntu8 0
        500 http://archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
        100 /var/lib/dpkg/status

This type of error doesn't occur with .c source files (using clang of course).
Clang++ used to work on raring perfectly till around 09 march (I think. However it always worked on my raring installation)
If you need more information, please feel free to contact me.
Thanks for your precious time and work,
Have a nice day

Giulio

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in clang (Ubuntu):
status: New → Confirmed
Revision history for this message
Benjamin Botwin (thecodethinker) wrote :

can someone please be assigned to this.

Revision history for this message
Paul Kilgo (paulkilgo) wrote :

I'm having the same problem in Ubuntu 14.04, and I've managed to blame it on gccgo-4.9 (gccgo) somehow.

My symptoms were like this: clang++ can't find any stl headers, seems to find C headers ok, but the linker can't find `-lstdc++`. It seemed to affect all the clang-3.x packages.

I tracked it down by installing every package I had one by one onto a VM until a simple C++ file stopped compiling successfully. It broke on installing `gccgo` which points you at `gccgo-4.9` in 14.04. Uninstalling gccgo-4.9 meant clang++ would work normally again.

Anyway I'm curious if that's the culprit for others.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.