C++11 in Haiku

How it can be used for Haiku apps dev?
Lack of auto and lambdas makes me sad.

Hi Arman,

If you are using the hybrid version, just type “setarch x86” to use gcc 5.4.0.
This version supports C++11 and C++14.
Otherwise it is natively supported on gcc4 and x86_64 distribution of Haiku.

I thought that only gcc2 and gcc4 supported in main version (which is called “gcc2 hybrid”, right?)

I always use the latest build.
gcc2hybrid for this latest version is using both gcc2 and gcc5.4.0 (the latest only being of interest for you).
By default the system is using gcc2.
If you type “getarch”, it will reply “x86_gcc2”.
Then “gcc --version” gets 2.95.3 (on my version).
To use c++ 11 you need a more recent version of gcc (which is called gcc4 because historically it was the first supported version.
Use “setarch -l” to list available versions.
Then “setarch x86” to switch to the gcc4 version (which is now using gcc 5.4.0).
A “gcc --version” will give you the version you are using.

Then you are good to use c++11.

1 Like

Thanks, I’ve got it.

I believe almost all of C++11 works with GCC5 – OpenMP, C++11 threads, etc. Of course if it doesn’t work, it’s a bug.

1 Like

Note that it is not called “gcc4” anymore. About the same time we switched to package management, the “modern” gcc architecture was renamed to just “x86” (with “x86_gcc2” referring to the older, BeOS compatible one).


I don’t know why you say that? the x86gcc2hybrid builds have support for GCC5, as is evidenced by WebPositive, which is built with GCC5 as WebKit uses C++11?

1 Like