Problems running .exe after compiling with gcc

Posted by Heide9095@reddit | learnprogramming | View on Reddit | 5 comments

Hi, I am a beginner in programming, but I am learning and willing to learn. I followed the simple "hello, world" program given in "the C Programming Language " 2nd ed book.

#include <stdio.h>

int main() {

printf("hello, world\n");

}

Thereafter I compiled it

gcc test.c -o test

Thereafter I located test.exe and ran it from the terminal

$ start test.exe

however a window flickers and disappears.

I found the .exe and ran it manually with the same result.

After some 'googling' I found similar cases online but in no case was the problem solved.

I am using windows 11, nvim and gcc through msys2.

Help is very much appreciated.