gcc/g++编译器编译文件时出错

当程序有问题时,编译器能正常反馈问题

示例代码:

#include <iostream>
#include <string>

using namespace std;

int main(){
    for (int x = 0; x < 50; x++){
        string mainf = to_string(x);
        cout << mainf << endl;
    }
    return 0      //没有分号
}

编译器正常输出

G:\codes\cpp\c++lring>g++ gbmaker.cpp
./gbmaker.cpp: In function 'int main()':
./gbmaker.cpp:15:1: error: expected ';' before '}' token
 }
 ^

但当补上分号并保存后输出了


G:\codes\cpp\c++lring>g++ gbmaker.cpp
gcc: error: CreateProcess: No such file or directory

这是为什么,求解