üzerinde clang ++ kullanarak derlemek için basit bir C++ programı olsun Ubuntu 16.04 LTS (sunucu) üzerinde derleme sorunlara koşuyorum. -std=c++11
bit içermezse tamamlanır. Clang versiyonu 3.8. Bunu Eğer clang++
sizin standart kütüphane için libc++
ve başlıklarını kullanarak yapalım etmesi gerektiği düşünülürse (doğru) beklenti içinde ubuntu 16.04 üzerinde libc++-dev
yüklemişUbuntu 16
>cat foo.cpp
#include <string>
#include <iostream>
using namespace std;
int main(int argc,char** argv) {
string s(argv[0]);
cout << s << endl;
}
>clang++ -std=c++11 -stdlib=libc++ foo.cpp
In file included from foo.cpp:1:
/usr/include/c++/v1/string:1938:44: error: 'basic_string<_CharT, _Traits, _Allocator>' is missing exception specification
'noexcept(is_nothrow_copy_constructible<allocator_type>::value)'
basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
^
/usr/include/c++/v1/string:1326:40: note: previous declaration is here
_LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
^
1 error generated.
-stdlib = libC++ olmadan çalışır mı? – xaxxon
Evet, görünüşte. – Darin
böylece libcdC++ üstbilgileri toplayıp libC++ değil. Bence bu bir linux dağıtımında normal. – xaxxon