Why this error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why this error?

I'm trying to build with a JSON file in VS Code. Here is the JSON: { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "echo", "type": "shell", "command": "g++", "args": [ "-o", "C:\\MinGW\\bin\\pointer.cpp", "C:\\MinGW\\bin\\SDL2main.lib" ], "group": { "kind": "build", "isDefault": true } }, { "label": "echo", "type": "shell", "command": "g++", "args": [ "-o", "C:\\MinGW\\bin\\pointer.cpp", "C:\\MinGW\\bin\\SDL2.lib" ], "group": { "kind": "build", "isDefault": true }, "problemMatcher": [ "$gcc" ] }, { "label": "echo", "type": "shell", "command": "g++", "args": [ "-o", "C:\\MinGW\\bin\\pointer.cpp", "C:\\cpp\\pointer.o" ], "problemMatcher": [ "$gcc" ] } ] } It produces this error: c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status The terminal process terminated with exit code: 1 I know this seems really complicated but if anyone out there knows why this is going wrong, please help. Thank you.

22nd Aug 2018, 11:40 PM
jacksonofgames 28
jacksonofgames 28 - avatar
7 Answers
0
You already tried this suggestions? http://www.cplusplus.com/forum/beginner/130068/ Seems similar to your problem
23rd Aug 2018, 8:24 AM
Chrizzhigh
Chrizzhigh - avatar
0
That actually is my exact error but they don't solve it
23rd Aug 2018, 9:47 PM
jacksonofgames 28
jacksonofgames 28 - avatar
0
So you have no problems with the different bit versions and also reinstalled VS and mingw gcc compiler? Also creating a new project as console application in VS did not work?
24th Aug 2018, 7:19 AM
Chrizzhigh
Chrizzhigh - avatar
0
Also from where is that script did vs create it? Maybe try to recreate the error with minimal amount of Sourcecode so one can see what you code.
24th Aug 2018, 7:20 AM
Chrizzhigh
Chrizzhigh - avatar
0
Some one who solve this problem
12th May 2020, 3:13 PM
Abhijeet Yadav
Abhijeet Yadav - avatar
0
Did you get this answer?
27th May 2020, 1:36 PM
Rya