Std::__cxx11problem when cross-compile using openwrt sdk 21

Hello,
I was using openwrt-sdk-19.07.7-x86-64_gcc-7.5.0_musl.Linux-x86_64 to compile a c++ project and it was working fine, generated ipk files and succesfully installed on openwrt 19.
When I changed to openwrt21, this package was not working and generated symbol not found error.

I am trying to cross-compile it using openwrt-sdk-21.02.1-x86-64_gcc-8.4.0_musl.Linux-x86_64 but I am getting this error:

/home/hela/Downloads/openwrt-sdk-21.02.1-x86-64_gcc-8.4.0_musl.Linux-x86_64/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/bin/../lib/gcc/x86_64-openwrt-linux-musl/8.4.0/../../../../x86_64-openwrt-linux-musl/bin/ld: ./src/common/lib/libnascodec.a(_5GSM_capability.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > className<_5GS::IE::_5GSM_capability const*>(_5GS::IE::_5GSM_capability const* const&)':
_5GSM_capability.cpp:(.text._Z9classNameIPKN4_5GS2IE16_5GSM_capabilityEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_[_Z9classNameIPKN4_5GS2IE16_5GSM_capabilityEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_]+0x6c): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:27: all] Error 1
make[4]: Leaving directory '/home/hela/Downloads/openwrt-sdk-21.02.1-x86-64_gcc-8.4.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/N3IWFC'
make[3]: *** [Makefile:71: /home/hela/Downloads/openwrt-sdk-21.02.1-x86-64_gcc-8.4.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/N3IWFC/.built] Error 2
make[3]: Leaving directory '/home/hela/Downloads/openwrt-sdk-21.02.1-x86-64_gcc-8.4.0_musl.Linux-x86_64/package/N3IWFC'
time: package/N3IWFC/compile#79.36#5.20#88.06
    ERROR: package/N3IWFC failed to build.
make[2]: *** [package/Makefile:114: package/N3IWFC/compile] Error 1
make[2]: Leaving directory '/home/hela/Downloads/openwrt-sdk-21.02.1-x86-64_gcc-8.4.0_musl.Linux-x86_64'

The error is linked to a static library, I downgraded gcc and g++ to 8.4 the same version as openwrt 21, and recompile the library but it did not resolve the issue.
I also used -std=c++11 and -lstdc++ on the makefile but no success.
I also used #define _GLIBCXX_USE_CXX11_ABI 0 on all the code with no luck.

Any suggestions please?