Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2013 17:35:40 -0700
From:      "Alexander K. Beros" <alex@154cm.com>
To:        <freebsd-toolchain@freebsd.org>
Subject:   missing some c++11 support for clang in FreeBSD
Message-ID:  <000301ce503a$fb8e8630$f2ab9290$@154cm.com>

next in thread | raw e-mail | index | archive | help

I have just started using clang (on FreeBSD 9.1 AMD64) and encountered a
couple problems.  I have worked around these points, but in case they
represent something unintentional (as opposed to some error on my part while
building from the port) I would like to mention them.  I am using

FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
Target: x86_64-unknown-freebsd9.0
Thread model: posix

A key element in solving both problems was the installation of gcc47.  That
was unexpected since I initially installed clang under the assumption that
FBSD is moving from gcc to clang and since gcc42 doesn't support c++11.

1.. 
Symptom:

	%>  clang++ -std=c++11 -stdlib=libstdc++ refparms.c++
	initListTest.cpp:43:10: fatal error: 'initializer_list' file not
found
	#include <initializer_list>

I had included initializer_list.

Temporary Solution:
	I built gcc47 from the port and then added the following to my
.cshrc file
	alias clang11 'clang++ -std=c++11 -I/usr/local/lib/gcc47/include/c++
-I/usr/local/lib/gcc47/include/c++/x86_64-portbld-	freebsd9.1'

Alternate solution, compile using g++47.

2..
Symptom:
	/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.14 required by
/usr/home/../binaries/a.out  not found

Solution:
	I added the following line to /etc/libmap.conf
	libstdc++.so.6  gcc47/libstdc++.so.6

	again compiling with g++47 had no such problem.
	
Best regards,
Alexander






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000301ce503a$fb8e8630$f2ab9290$>