首先给到报错代码:
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.
目前所搜集到,该问题可能与环境变量有关,但经调整后仍不能正常运行,且正常的简单程序可以正常运行,如下可以正常实现简单的乘法表的打印
#include <iostream>
using namespace std;
int main()
{
for (int i = 1; i < 10; i++)
{
for(int j = 1; j <= i; j++)
{
cout << j << "*" << i << "=" << j*i << "\t";
}
cout << endl;
}
system("pause");
return 0;
}

但是当我调用STL容器中的vector,并使用auto关键字时,却无法正常运行,代码如下:
#include<iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> arr;
arr.push_back(1);
arr.push_back(2);
arr.push_back(3);
arr.push_back(4);
// arr.resize(3);
for(auto ele : arr){
cout << ele << endl;
}
system("pause");
return 0;
}
该程序没有报错,但却无法运行,在调试控制台发现报错:

实在不知道是因为什么,感谢各位的帮助!