Compilation failed with using std::string or std::thread

Hellow,

Probably a stupid question.
I am writing software for data conversion from a serial line. When I wanted to use std::string or std::thread functions, compilation of buildroot OpenWrt 19.07 with my sources failed (when I compile the same sources under Ubuntu 21.10, all works fine). After googling I tried to add -std=c++11 and -pthread into makefile, but without success.
Doing I am something wrong or just this functions OpenWrt compilator not contain and I cannot use them?

Thanks for answers...