Recently I downloaded gfortran through tdm-gcc, and I downloaded Visual Studio Code with three add-ons: C/C++, Modern Fortran, and Code Runner. I created a folder labeled “Fortran Projects” and attached it to VSC. Whenever I run any program, no matter what it is, I always get the same error message:
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function main': C:/crossdev/src/mingw-w64-v8-git/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to
WinMain’
collect2.exe: error: ld returned 1 exit status.
I am new to programming, so can anyone tell me what’s wrong?
By the way, this is on Windows 11
One program I tried was a simple Hello World program, and it gave me the same error message. Same with more advanced programs.
JoeTheGreatest616 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.