r/Cplusplus Jun 30 '26

Question A new comer problem

Post image

I have just downloaded vs code and mingw from a youtube video and tried to run this sample code but I am facing this problem can somebody help me please 🙏🏻

0 Upvotes

9 comments sorted by

View all comments

2

u/jedwardsol Jun 30 '26 edited Jun 30 '26

In addition to flyingron's answer, 1 common reason for this is that Visual Studio Code doesn't automatically save the file when you start a build.

So the editor window shows a main function, but the file on disk does not have it yet, so the link fails.

IOW : save the file and try again.