[python-win32] Compiling Python as a static .exe

Russell Wallace russell.wallace at gmail.com
Mon Jan 20 14:12:04 CET 2014


Hi,

I'm trying to compile Python 2.7.6 as a statically linked 64-bit Windows
executable, and I'm getting a weird error message. As per
http://stackoverflow.com/questions/21231439/unresolved-external-symbol-main-no-underscore
I
have a command line that looks like:

cl /DPy_BUILD_CORE ... /link Advapi32.lib Shell32.lib User32.lib

which gets as far as invoking the linker, and then fails with the error:

LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main
referenced in function __tmainCRTStartup

unusually, there is no _ in front of main here, though I tried separately
providing both main() and wmain() and it made no difference.

What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20140120/055ba907/attachment.html>


More information about the python-win32 mailing list