diff -r 459500606560 PC/frozen_dllmain.c --- a/PC/frozen_dllmain.c Sat Dec 31 11:40:11 2016 +0000 +++ b/PC/frozen_dllmain.c Sat Dec 31 19:43:10 2016 +0200 @@ -46,6 +46,8 @@ ***************************************************************************/ #include "windows.h" +#include "Python.h" + static char *possibleModules[] = { "pywintypes", "pythoncom", diff -r 459500606560 Tools/freeze/checkextensions_win32.py --- a/Tools/freeze/checkextensions_win32.py Sat Dec 31 11:40:11 2016 +0000 +++ b/Tools/freeze/checkextensions_win32.py Sat Dec 31 19:43:10 2016 +0200 @@ -178,7 +178,7 @@ """ ext_src_footer = """\ -extern DL_IMPORT(int) PyImport_ExtendInittab(struct _inittab *newtab); +extern __declspec(dllimport) PyImport_ExtendInittab(struct _inittab *newtab); int PyInitFrozenExtensions() { diff -r 459500606560 Tools/freeze/winmakemakefile.py --- a/Tools/freeze/winmakemakefile.py Sat Dec 31 11:40:11 2016 +0000 +++ b/Tools/freeze/winmakemakefile.py Sat Dec 31 19:43:10 2016 +0200 @@ -1,4 +1,4 @@ -import sys, os +import sys, os, platform # Template used then the program is a GUI program WINMAINTEMPLATE = """ @@ -71,9 +71,10 @@ print('!ENDIF') print() + architecture_dir = 'win32' if platform.architecture()[0] == '32bit' else 'amd64' print('# The following line assumes you have built Python using the standard instructions') print('# Otherwise fix the following line to point to the library.') - print('pythonlib = "$(pythonhome)/pcbuild/python%s$(debug_suffix).lib"' % version_suffix) + print('pythonlib = "$(pythonhome)/pcbuild/%s/python%s$(debug_suffix).lib"' % (architecture_dir, version_suffix)) print() # We only ever write one "entry point" symbol - either