LINK : fatal error LNK1561: entry point must be defined

c:\Users\pkdiv\OneDrive\Documents\VSCode files>cl Test.cpp
Microsoft ® C/C++ Optimizing Compiler Version 19.21.27702.2 for x86
Copyright © Microsoft Corporation. All rights reserved.

Test.cpp
Microsoft ® Incremental Linker Version 14.21.27702.2
Copyright © Microsoft Corporation. All rights reserved.

/out:Test.exe
Test.obj
LINK : fatal error LNK1561: entry point must be defined

C++ code in the editor:
int main()
{
//comment
return 0;
}

Did you save the file?

Yes . I saved the file

Because that error message says you don’t have what you say you have in Test.cpp. main is the entry point, so it’s saying you don’t have that.

1 Like

Thank you . It is working now . There was problem with the file location.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms