The below line is an Visual C++ only line.
Code:
#pragma comment(linker, "/subsystem:windows")
To fix you need to add the linker option for MinGW GCC that matches the above option.
from Compiling Windows GUI Application With MinGW Without Command Prompt
The old option was this
It was replaced in newer version of MinGW GCC with
Code:
-Wl,-subsystem,windows
I suggest finding directions for the same Compiler (MinGW GCC) you are using; the frustrations will be much less. Or, changing to use the Compiler in your directions.
Tim S.