Some Backstory and Info:-
This is my first time using Stack Overflow. So I may be inefficient in describing my issues, I apologize for that.
I mainly use C++, and also know C and Python.
I am a college student learning Computer Science, and would say that I have Intermediate coding skills, but I always used online compilers to do code like OnlineGDB or Programiz.
Now I am trying to use an Offline Compiler, the most popular being VS Code. But I am just unable to properly set it up.
I have intermittently tried to set it up from scratch multiple times still it just doesn’t seem to work.
I have watched multiple tutorials, still it doesn’t work.
The Issues Are:-
- Whenever I run code on it it just throws errors “Undefined Reference to WinMain”.
Here is what it shows.
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-crtexewin.o): in function main': C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexewin.c:67:(.text.startup+0xbd): undefined reference to
WinMain’
collect2.exe: error: ld returned 1 exit status
-
When I run VS Code using the New Project command prompt using ‘mkdir’ given in the VS Code website, it makes a new folder on its own, and the programs do execute as intended only if it doesn’t take user inputs.
When taking user inputs it just doesn’t take it. Be it typing normally after executing the code, or after taking the cursor to the output part.
Here is the failed input process for an integer input on a Simple Salary output code. -
I also can’t seem to figure out how to manage the different files and folders, how to properly create new files, which files are executable and which are text files. What are the requirements for the folders to be used by VS Code. I have tried finding tutorials for it, but everyone just does it so effortlessly that I just can’t replicate it, also the fact that the compiler itself hasn’t been working for me.
I feel too overwhelmed with all the buttons and options available, as I don’t understand a huge part of the lingo.
Closure:-
I have installed mingw, msys2, and put the proper path variables, and undone and redone it multiple times. Still i can’t figure it out on my own and with each attempt i keep feeling more and more helpless.
The irony is, I helped a friend setup C++ on his VS Code a few days ago using tutorials, and it worked for him perfectly fine (Although he did Java coding on it previously).
Although I have prior coding knowledge and exam question knowledge, I am a hopeless noob for computer applications like this, as I am highly reliant on my mobile and seldom use my Laptop for work, thus this all feels a bit over the top for me.
If any more information is required I will be happy to provide it.
Any useful tutorial recommendations or tips are greatly appreciated.
Thanks in advance.
I have tried multiple times to run VS Code on my laptop still it doesn’t work.
ARUNAVA MUKHERJEE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1