Ubuntu-core C++ compiler issue

Hi, I am trying to build a snap consisting of

snapcraft.yaml

.
.
protobuf-build:
    plugin: autotools
    source: https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-cpp-3.17.3.tar.gz
    source-type: tar
    after:
      - protobuf-build-x86
    build-packages:
      - clang
      - on amd64:
        - g++-aarch64-linux-gnu
        - gcc-aarch64-linux-gnu
    autotools-configure-parameters:
      - --build x86_64-pc-linux-gnu
      - --host aarch64-linux-gnu
      - --with-protoc=${CRAFT_STAGE}/usr/bin/protoc
      - CXXFLAGS="-fPIC"
.
.

I am getting the error as

.
.
2023-05-24 08:42:51.154 :: checking whether clang++ supports C++11 features by default... no
2023-05-24 08:42:51.185 :: checking whether clang++ supports C++11 features with -std=c++11... no
2023-05-24 08:42:51.211 :: checking whether clang++ supports C++11 features with +std=c++11... no
2023-05-24 08:42:51.238 :: checking whether clang++ supports C++11 features with -h std=c++11... no
2023-05-24 08:42:51.269 :: checking whether clang++ supports C++11 features with -std=c++0x... no
2023-05-24 08:42:51.296 :: checking whether clang++ supports C++11 features with +std=c++0x... no
2023-05-24 08:42:51.323 :: checking whether clang++ supports C++11 features with -h std=c++0x... no
2023-05-24 08:42:51.323 :: configure: error: *** A compiler with support for C++11 language features is required.
2023-05-24 08:42:51.537 'override-build' in part 'protobuf-build-x86' failed with code 1.
Review the scriptlet and make sure it's correct.
.
.

gcc and g++ versions are as follows.

ubuntu@ubuntu22:~/myrepo$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ubuntu@ubuntu22:~/myrepo$
ubuntu@ubuntu22:~/myrepo$
ubuntu@ubuntu22:~/myrepo$
ubuntu@ubuntu22:~/myrepo$ g++ --version
g++ (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Can you please let me know what might be the causing issue?