-2

So I recently upgraded Windows 8.1 to Windows 10. I didn't faced this type of error before but when I program in c++ and include "string" header file then it pops out an error when executing though compiling does not give any error. I tried using "cstring" and update Microsoft Visual C++ Redistributable but no change. If I don't use "string" header file then it will not produce any error.

Here is test.cpp

#include <iostream>
#include <string>

using namespace std;

int main(){
   string text = "Hello World!";
   cout << text;
   return 0;
}

On compiling it does not give error

g++ test.cpp -o test.exe

But when I tried to execute via console it doesn't print anything. And when I tried to execute by double clicking "test.exe" then it showed me this

enter image description here

1 Answers1

1

Finally I found what causes this error. There was a faulty app which is set in my system path variable containing a faulty libstdc++-6.dll which causes this error. I remove the path from th system path variable and now everything working fine.