I am using the latest MinGW to compile my c++ code with g++ compiler on Windows 10. The code compiles without errors but when I run the execution file it gives the error:
The problem was with libstd++6.dll. It was solved by using the argument -static-libstdc++ in g++. MinGW was taking libstd++6.dll from Windows instead of the one in MinGW.