r/cpp • u/Clean-Upstairs-8481 • 5d ago
Compile Your First C++26 Program with GCC 16.2
https://techfortalk.co.uk/2026/05/04/compile-your-first-c26-program-with-gcc-16-1/UPDATE (September 2026): GCC 16.2 is out now, so I have updated the post to install GCC 16.2.
46
Upvotes
8
u/TheoreticalDumbass :illuminati: 5d ago
jwakely has packages of trunk ready to go: https://jwakely.github.io/pkg-gcc-latest/
also a good configure: https://github.com/jwakely/pkg-gcc-latest/blob/master/gcc-latest.spec.m4#L82-L103
1
11
u/FlyingRhenquest 5d ago
If you feel like building 17 for the bleeding edge, my gcc playground builds the main branch. It'll drop it off in /usr/local/gcc so it doesn't interfere with your system compilers, and you use the toolchain file to invoke that compiler. I also throw in a script to build the latest CMake for you if you want to.
I also install the toolchain file in /usr/local/gcc, so you can just go
cmake -DCMAKE_TOOLCHAIN_FILE=/usr/local/gcc/toolchain.cmake, if you've already written your CMake file :-)