0

I am new to c++. I have installed MingGw 64 and vscode and I am trying to run this basic program but this message comes up.

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function main':
C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status 

I do not understand what this is saying. Did I not install something incorrectly or do I need to change some settings?

Jason
  • 36,170
  • 5
  • 26
  • 60
Crown
  • 1
  • Running BASIC programs through a C++ compiler rarely works. – user4581301 Feb 23 '22 at 18:47
  • Bad attempts at humour in the past, please add that basic program to the question so we can see it and possibly eliminate the trivial stuff like forgetting `main` or a small typo. – user4581301 Feb 23 '22 at 18:48
  • Assuming the code is correct, the VSCode Gurus may need to see the VS Code configuration files. The error message is reminiscent of providing console program code to a toolchain expecting a GUI program. – user4581301 Feb 23 '22 at 18:49
  • Please share minimal reproducible example code and the command you use. Make sure there is a `main()` function in the code. You may also need the `-mconsole` linker flag. – Brecht Sanders Feb 23 '22 at 21:55

0 Answers0