jeudi 1 mai 2014

Clang sur Amazon Linux de EPEL ne trouve pas les en-têtes de C++ ou bibliothèques - Stack Overflow


I'm trying to compile a simple hello world test program just to get things working on our CI infrastructure build boxes and it refuses to compile on CentOS with clang (but works fine with GCC on the same platform). For completeness, here is the obviously trivial program:


#include <iostream>

int main(){
std::cout << "wow" << std::endl;
return 0;
}

Running clang++ test.cpp yields:



test.cpp:1:10: fatal error: 'iostream' file not found



I installed it with a simple sudo yum install clang and can see that when GCC gets installed on Amazon Linux it comes with its own libstdc++ headers which are in /usr/include/c++/gcc-version but it seems odd to have to specify includes to compile something like this.


Clang should be using its own (possibly libc++) instead and know where the headers and libs are on the system by default (for something like iostream at least).


Compiling and running the program works just fine with GCC here. It seems like the EPEL package for clang may not have been configured correctly, is this the case? Any help would be greatly appreciated.



I'm trying to compile a simple hello world test program just to get things working on our CI infrastructure build boxes and it refuses to compile on CentOS with clang (but works fine with GCC on the same platform). For completeness, here is the obviously trivial program:


#include <iostream>

int main(){
std::cout << "wow" << std::endl;
return 0;
}

Running clang++ test.cpp yields:



test.cpp:1:10: fatal error: 'iostream' file not found



I installed it with a simple sudo yum install clang and can see that when GCC gets installed on Amazon Linux it comes with its own libstdc++ headers which are in /usr/include/c++/gcc-version but it seems odd to have to specify includes to compile something like this.


Clang should be using its own (possibly libc++) instead and know where the headers and libs are on the system by default (for something like iostream at least).


Compiling and running the program works just fine with GCC here. It seems like the EPEL package for clang may not have been configured correctly, is this the case? Any help would be greatly appreciated.


0 commentaires:

Enregistrer un commentaire