Linker Tools Error LNK1561

entry point must be defined

The linker did not find an entry point. You may have intended to link as a DLL, in which case you should link with the /DLL option. You may have also forgotten to specify the name of the entry point; link with the /ENTRY option.

Otherwise, you should include a main, wmain, WinMain, or wMain function in your code.

If you are using LIB and intend to build a .dll, one reason for this error is that you supplied a .def file. If so, remove the .def file from the build.

The following sample generates LNK1561:

// LNK1561.cpp
// LNK1561 expected
int i;
// add a main function to resolve this error