# Looking for C++ compiler with c++11 implementation



## freethread (Jan 2, 2014)

I'm looking for a C++ compiler (on FreeBSD 9.2-RELEASE) that has c++11 implementation. I'm trying to compile some simple source that includes <codecvt> and makes use of wstring_convert without success. The compilers I've played with are the system clang 3.3, gcc 4.6 and gcc 4.8. The system clang compiler should implement codecvt, but it doesn't (neither with libc++ nor stdlibc++), perhaps it still makes use of system gcc libraries.

I found the codecvt header in /usr/src/contrib/libc++/include, I don't know the reason why it's not in /usr/include or in the system clang headers library. Do or don't I need to build the system from source with some special options?

Does anyone know if there is a compiler in ports with c++11 (hopefully full) implementation? Actually I use other methods (multiplatform) in C (wcstombs and counterpart) and in C++ (facets) but I'd really like to change to a single-line encoding conversion. Thanks for watching.


----------



## sossego (Jan 2, 2014)

You may want to contact Brooks Davis aka brooks@freebsd.org since he is the maintainer of Clang on FreeBSD and ask him about the current state of 3.5 being ported. I started working on building 3.5 on my laptop when the power brick crapped out on me this morning.


----------



## freethread (Jan 3, 2014)

sossego said:
			
		

> You may want to contact Brooks Davis aka brooks@freebsd.org since he is the maintainer of Clang on FreeBSD and ask him about the current state of 3.5 being ported. I started working on building 3.5 on my laptop when the power brick crapped out on me this morning.



Many thanks for your suggestion, I will contact Mr. Brooks about clang. In the ports tree there are both clang version 3.3 and 3.4.r2, perhaps installing one of them will satisfy my request, but I'd better ask him. Thanks again.


----------



## freethread (Jan 4, 2014)

In the meantime, I'm testing a new solution using Boost.Locale functions to_utf, from_utf and utf_to_utf.

To compile the executable with static libraries (iconv and Boost.*) I recompiled boost without ICU support (defaults to iconv), With ICU I was not able to compile a monolithic executable. Boost libraries are compiled with shared ICU libraries.

However, I compiled it with system gcc version 4.2, trying to compile with other versions, say 4.8, gave me a glibc++ run-time error, i.e. the executable was not linked against the versioned GCC stdlibc++ (4.8) but against the system one (4.2). I guess I have to disable default system libraries (-nodefaultlibs & Co) and add versioned directory search.


----------

