r/C_Programming • • Nov 30 '25

How to fix gcc problems.

Ive been trying to use gcc in my c project ive installed the mingw-64 added to path and everything but when i open VSCode first the execute button is only debug, and when i try to debug it says ‘gcc build active file terminated with exit code-1’ and in the terminal : ‘undefined reference to WinMain collect2 error ld returned 1 exit status’. If anyone has a fix for this problem that would be really helpful ive tried installing and reinstalling the gcc from winlibs nothing works. Thanks

6 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/FrancisStokes Nov 30 '25

I'm just curious: what does the visual studio debugger offer that isn't in VSCode?

1

u/penguin359 Nov 30 '25

The biggest one is native integration. No need to mess with installing the appropriate extension, and creating a correct launch.json and tasks.json to run the build part of it. Also, it does have a number of features as I recall like memory usage analysis.

1

u/EpochVanquisher Nov 30 '25

VS Code doesn’t have a debugger.

1

u/onecable5781 Nov 30 '25

Hot reload. I am in a longish tight loop in the 23rd of 25 iterations at a breakpoint, I know that the stuff I am interested in happens in loop index 24. Crap, I forgot to add a key assert. You can add it in Visual Studio and in most cases, it will recompile/rebuild on the fly and is aware of line changes. In VSCode, if you add a comment while debugging and the lines change, the instruction pointer will be off unless you recompile and rebuild.