I want to compile a HelloWorld in Python with Cython using mingw-w64. I could create the HelloWorld.c using this command:
cython --embed -o HelloWorld.c HelloWorld.py
But then I can manage to be able to generate a HelloWorld.exe
I use the following command:
gcc -Os -I C:\Users\user\AppData\Local\Programs\Python\Python36\include -o HelloWorld HelloWorld.c
And I get the following error:
C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x39): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
I checked that there aren't any "wmain" like some threads suggest (Compile main Python program using Cython)
Python Version: 3.6
Windows 10
C Compiler: MinGW-w64
HelloWorld.py
def main():
print("Hello world!")
if __name__== "__main__":
main()