0

I'm a begginer in C programming and I was trying to use VSC(Windows 10, 64) to compile and run c files that I did previously on CodeBlocks. So I installed VSC added the c/c++ and code runner extensions(checked the "run in terminal option on the runner extension),downloaded and installed MinGW and added new local variables corresponding to the bin folder of MinGW.

Still when I try to compile and run something on VSC I get undefined reference to `WinMain@16'. I've tried to reinstall both MinGW and VSC, updating my netframework... still, I can't even compile and run new files on VSC.

Help, please.

Miguel
  • 1
  • 1
    You may want to try out something more integrated like Visual Studio Community with a built-in compiler and dependency tracker. Visual Studio Code is nowhere near as complete. The MinGW compiler is also very out of date compared to modern VCC. – tadman Apr 26 '21 at 04:04
  • @tadman [MinGW-w64](http://mingw-w64.org/doku.php) (through [MSYS2](https://www.msys2.org/)) has [GCC 10.2](https://packages.msys2.org/base/mingw-w64-gcc), not sure why you think that is out of date? Ye olde MinGW.org stuff is indeed terribly out of date, but no one should be using that anymore... It seems even the website has gone down! – rubenvb Apr 26 '21 at 06:51
  • There's also a MinGW distro built by Microsoft's STL (Stephan T. Lavavej), which he keeps relatively up to date with a few core C++ libraries: https://nuwen.net/mingw.html – rubenvb Apr 26 '21 at 06:52
  • @rubenvb When people say "MinGW" I just assume the worst. The forked version is a lot better, but has virtually the same name. – tadman Apr 26 '21 at 07:00
  • @tadman Well, you assuming the worst is no reason to say something untrue, and then suggest a completely different alternative that may not even be something that the OP can use at all due to licensing restrictions (VS Community requires a max of 5 developers if used in a commercial context). Best to then ensure people are using the new thing. Remember, it's not even a fork, it was a clean room implementation with the intent of providing 64-bit support, and quickly turned into the most complete base layer for open source toolchains on Windows. – rubenvb Apr 26 '21 at 07:05
  • @rubenvb I'm not trying to get into a fight here. I just see a lot of people struggling with the old MinGW tool and it's often for a lack of knowing there's better options, so I just mention VS/VCC as an alternative, as in many cases, especially as a learning tool, it's much more complete. As for MInGW it's utterly ridiculous they didn't change the name to something different. The old MinGW name is dragging that project down and should be cut loose. – tadman Apr 26 '21 at 07:08
  • Does this answer your question? [undefined reference to \`WinMain@16'](https://stackoverflow.com/questions/5259714/undefined-reference-to-winmain16) – the busybee Apr 26 '21 at 07:51

0 Answers0