win11 clion 编写C++的代码,为什么exe无法执行呢?

win11 clion 编写C++的代码,为什么exe无法执行呢?

build之后的exe文件,总是执行不起来;

总是报错:↓

牛逼了,我的大兄弟:

 

#include <iostream>

int main() {
    system("chcp 65001 > nul");  //解决命令行中的中文编码问题
    std::cout << "Hello, World!" << std::endl;
    std::cout << "Hello, World!" << std::endl;
    std::cout << "Hello, World!" << std::endl;
    std::cout << "Hello, World!" << std::endl;
    std::cout << "Hello, World!" << std::endl;
    std::cout << "中文编码测试" << std::endl;
    system("pause");
    return 0;
}

posted @ 2022-03-21 14:29  bH1pJ  阅读(44)  评论(0编辑  收藏  举报