PrevUpHomeNext

gcc: c++ compiler on SereniyOS, Haiku OS, Linux, Windows


Jump in this page:
Start
Get Gcc & Build & Install
Install From Distribution
c++ code Editor
Check compiling

Back: c++ compilers

Get Gcc & Build & Install

Get gcc code:

git clone --depth=1 https://gcc.gnu.org/git/gcc.git SomeLocalDir

SerenityOS

cd SerenityOS-Project-Dir/Ports/gcc
./build.sh

Haiku OS

Build it.

Linux

cd SomeLocalDir
./configure --help
./configure \
	--prefix=/gcc \
	--disable-multilib \
	--enable-languages=c++ \
	--enable-stage1-languages=c++ \
	--build=x86_64-linux-gnu \
	--host=x86_64-linux-gnu \
	--target=x86_64-linux-gnu
make -j8
make install

Windows

Use mingw64.

Install From Distribution

SerenityOS

No gcc distribution.

Haiku OS

Gcc is distributed to haiku os image, and it can be installed by pkgman too:

pkgman search gcc
pkgman install gcc

Linux

apt install gcc

Windows

Use mingw64.

c++ code Editor

Many good editors can be used for writing c++ code.

Kakoune

Kakoune can be installed to SerenityOS, Haiku OS, Linux, Windows.

Featherpad

Featherpad can be installed to Haiku OS, Linux.

Native Text Editor

Check compiling

Check if the c++ compiler works.

Copy paste the following c++ code, and save as hello.cpp:

#include <iostream>

int main()
{
	std::cout << "Hello, c++!" << std::endl;
}

Compile and run the c++ code:

g++ hello.cpp -std=c++26 -lgcc_s -o hello
./hello

It should output:

Hello, c++!

If the gcc c++ compiler can not compile c++ code, find and repair issues, or ask for help.

Date

Sun Sep 6 02:02:48 AM UTC 2026

Back

Back: c++ compilers

Helpful

Spaceship 50 Years Alienated

Role

+

Powered by:
B2 Build | boost quickbook

+

Donate

+

@cppfx.xyz


















PrevUpHomeNext