From owner-freebsd-questions@FreeBSD.ORG Tue Aug 27 08:11:51 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B33B93D1 for ; Tue, 27 Aug 2013 08:11:51 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 52DB724E2 for ; Tue, 27 Aug 2013 08:11:51 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlwGADxeHFJR8njd/2dsb2JhbABagwc1wHuBIxd0giQBAQVWIxALGAklDyoQDgYTiAW4NZB3B4QZA5Adh1CBLpA0gyA6 Received: from 221.120-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.120.221]) by relay.skynet.be with ESMTP; 27 Aug 2013 10:11:44 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r7R8BgBJ001589; Tue, 27 Aug 2013 10:11:43 +0200 (CEST) (envelope-from tijl@coosemans.org) Date: Tue, 27 Aug 2013 10:11:37 +0200 From: Tijl Coosemans To: Quark Subject: Re: c++11 question: clang++ 3.3 header not found Message-ID: <20130827101137.60e15b53@kalimero.tijl.coosemans.org> In-Reply-To: <1377588169.38174.YahooMailNeo@web190702.mail.sg3.yahoo.com> References: <1377588169.38174.YahooMailNeo@web190702.mail.sg3.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/_u2O9QagPXDGKEDQGaZXZP_"; protocol="application/pgp-signature" Cc: "freebsd-questions@freebsd.org" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2013 08:11:51 -0000 --Sig_/_u2O9QagPXDGKEDQGaZXZP_ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, 27 Aug 2013 15:22:49 +0800 (SGT) Quark wrote: > % uname -a > FreeBSD cobalt 9.2-RC3 FreeBSD 9.2-RC3 #0 r254795: Sat Aug 24 20:25:04 UT= C 2013 =A0 =A0 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC =A0am= d64 >=20 > % clang++ --version > FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 > Target: x86_64-unknown-freebsd9.2 > Thread model: posix >=20 > test program > #include > #include >=20 > int main( int argc, char* argv[]) > { > =A0 =A0 =A0 =A0 auto f =3D std::async( [] () { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 std::cout << "Hello, Worl= d!" << std::endl; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }); > =A0 =A0 =A0 =A0 f.wait(); > =A0 =A0 =A0 =A0 return 0; > } >=20 >=20 > error received is > % clang++ -otest test.cc >=20 > test.cc:2:10: fatal error: 'future' file not found > #include > =A0 =A0 =A0 =A0 =A0^ > 1 error generated. >=20 > I guess clang is re-using system headers which belong to older gcc 4.2 > I also have gcc48 installed, how can I make clang to refer gcc48 headers? There two C++ runtime libraries, the old gcc libstdc++ which is used by default and the new C++11 libc++. You can use the latter like this: clang++ -std=3Dc++11 -stdlib=3Dlibc++ -otest test.cc --Sig_/_u2O9QagPXDGKEDQGaZXZP_ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iF4EAREIAAYFAlIcXz0ACgkQfoCS2CCgtiv65wD/UzibnZLazpX5LHpSaTDIGRzn SloQSeyfokjqrbdlKx4BAIPJJtIaL1SiLDyOZQ6AMDBZs/bmAioXKhOy0VHwcmQQ =Xq4g -----END PGP SIGNATURE----- --Sig_/_u2O9QagPXDGKEDQGaZXZP_--