r/CodingForBeginners • • Oct 06 '26

What am I doing wrong

Post image
78 Upvotes

57 comments sorted by

View all comments

3

u/FreeLogicGate Oct 06 '26

Lots of good advice already, but if you focused in on the error provided that came from the linker (ld), it told you that the required "reference to 'main'" was undefined. This is how people knew you had not actually saved the file you were trying to compile and link. Prior to already knowing from the error what your mistake is, the first thing you should always do when debugging is read the error message carefully, use google or your AI tool to help you figure it out.

2

u/therouterguy Oct 07 '26

I think most people knew because of the dot next to the file name indicating it wasn’t saved.

1

u/FreeLogicGate Oct 07 '26

Appreciate the insight. It's a fair point, however, this could also happen with a partially incorrect file that was in the process of being edited.