入门C++用cout输出就报段错误?

lz本科传统工科大二在读,准备涉猎嵌入式开发,现以vscode作为编辑器,初学C++。第一个程序就有问题?
具体问题:
每次在使用cout输出字符串的时候就报段错误?
情况如下图:

img

为避免是示例代码中vector的问题,我有把一个简单的输出语句放在前面,在执行的时候还是有段错误。

img

不确定是什么原因,阅读了Microsoft visualstudio提供的教程完成了mingw64的下载、路径的配置和相应文件的编写,暂时未能发现有异常和没实现的步骤。(https://code.visualstudio.com/docs/cpp/config-mingw
在网上找了找线索,有一种说法是库的版本有问题,但是我这里是从官方网站下载的最新版,不太理解问题究竟是出在哪里。
用printf是可以的。我用一个int变量a分别使用cout和pritnf来打印,只要到cout这一步就会报段错误,所以十分疑惑什么导致了我一用cout就有段错误呢?这个尝试过程结果图示如下:

img

img

请热心的朋友帮我看看叭~(泪目)

附:代码文本内容如下:

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
/*
    int a = 1;
    a*=2;
    printf("%d\n",a);
    cout<<a;
*/
    //cout<<"Hello World!"<<"\n"<<endl;

    vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};

    for (const string& word : msg)
    {
        cout << word << " ";
    }
    cout << endl;
}

程序没有问题, debug load julia 什么鬼, 为什么c++的dll要从julia导入.

是不是没配置好

试试看 auto

#include <iostream>
#include <vector>
using namespace std;

int main() {
    vector<string> msg {"hello", "C++", "world", "from"};

    for (const auto& word : msg) {
        cout << word << " ";
    }

    return 0;
}

img