How to compile this with MinGW on Cygwin?
I tried by replacing CC with: x86_64-w64-mingw32-gcc. But got:
$ make
x86_64-w64-mingw32-gcc -c -Os -m64 -mwindows -Wall -Wextra -fstack-check XConPty.c -o ../bin/XConPty.obj
XConPty.c: In function‘XConPty’:
XConPty.c:60:5: error: unknown type name ‘STARTUPINFOEXW’
STARTUPINFOEXW SInfoEx = { 0 };
^~~~~~~~~~~~~~
XConPty.c:68:50: error: ‘ENABLE_VIRTUAL_TERMINAL_PROCESSING’ undeclared (first use in this function)
hRes = SetConsoleMode(hStdOut, consoleMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
XConPty.c:68:50: note: each undeclared identifier is reported only once foreach function it appearsin
XConPty.c:46:5: warning: implicit declaration of function‘ProcThreadAttributeValue’ [-Wimplicit-function-declaration]
ProcThreadAttributeValue (ProcThreadAttributePseudoConsole, FALSE, TRUE, FALSE)
^
XConPty.c:46:5: note: in definition of macro ‘PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE’
ProcThreadAttributeValue (ProcThreadAttributePseudoConsole, FALSE, TRUE, FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~
XConPty.c:107:12: error: request formember ‘StartupInfo’in something not a structure or union
SInfoEx.StartupInfo.cb = sizeof(STARTUPINFOEXW);
^
XConPty.c:107:37: error: ‘STARTUPINFOEXW’ undeclared (first use in this function)
SInfoEx.StartupInfo.cb = sizeof(STARTUPINFOEXW);
^~~~~~~~~~~~~~
XConPty.c:108:12: error: request formember ‘lpAttributeList’in something not a structure or union
SInfoEx.lpAttributeList = AttrList;
^
XConPty.c:120:17: error: request formember ‘StartupInfo’in something not a structure or union
&SInfoEx.StartupInfo,
^
XConPty.c:60:20: warning: variable ‘SInfoEx’ set but not used [-Wunused-but-set-variable]
STARTUPINFOEXW SInfoEx = { 0 };
^~~~~~~
make: *** [Makefile:30: ../bin/XConPty.obj] Error 1
Also note that mingw-make no longer exist, as used in your instructions.
I also tried by importing the phnt headers. Made things worse.