Ok, sorry to answer my own question, but yeah.. maybe others can benefit.
Seems that MSFT and their ONNY runtime don't follow strict c++ rules.
So compile with "-std=c++17" will fail. Instead, when using GCC, compile with "-std=gnu++17" or "-std=gnu++20" will be ok.
Btw, I found that if you don't specify "-std=.." at all, GNU compiler will use a default "g++17" or whatever was built for. So that's why is working silently on my side.