I'm trying to compile a C program (specifically, the Python interpreter) as a plain statically linked 64-bit Windows binary. My command line looks like this:
cl /DPy_BUILD_CORE ... /link Advapi32.lib Shell32.lib User32.lib
where ...
is the long list of source files and include directory specifications, and the library specifications I added as necessary to fix unresolved symbol errors. I'm now getting this error:
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
You might think this question has been asked before, but in this case main
is spelled without a leading _
- something that doesn't happen in any of the other occurrences I could find with a Google search. Just to be sure, I tried writing a minimal main()
function and throwing it in, and that still gave the above error plus a duplicate symbol warning, so that's not what's missing.
Any idea what's wrong here?