Ida*_*dan 9 python static compilation static-libraries python-2.7
I'm trying to build Python 2.7 as a static single .lib file.
I've already made the following changes to the Python source code:
I've managed to compile the pythoncore project to pythoncore.lib (about 11mb size), but when trying to compile the python project I get the following linking errors:
error LNK2019: unresolved external symbol __Py_ActivateActCtx referenced in function __PyImport_GetDynLoadFunc C:\Python-2.7.3_Source\PCbuild\pythoncore.lib(dynload_win.obj) error LNK2019: unresolved external symbol __Py_DeactivateActCtx referenced in function __PyImport_GetDynLoadFunc C:\Python-2.7.3_Source\PCbuild\pythoncore.lib(dynload_win.obj) error LNK2019: unresolved external symbol __Py_hgidentifier referenced in function __PySys_Init C:\Python-2.7.3_Source\PCbuild\pythoncore.lib(sysmodule.obj) error LNK2019: unresolved external symbol __Py_hgversion referenced in function __PySys_Init C:\Python-2.7.3_Source\PCbuild\pythoncore.lib(sysmodule.obj) error LNK2019: unresolved external symbol _Py_GetBuildInfo referenced in function _Py_GetVersion C:\Python-2.7.3_Source\PCbuild\pythoncore.lib(getversion.obj)
谁能帮我?
谢谢,
伊詹
--------------------更新----------------------------- --------
我只是设法让它工作..如果它会帮助任何人,这些是我做的改变:
Modules\getbuildinfo.c
到pythoncore项目.PC\dl_nt.c
移动该线#ifdef Py_ENABLE_SHARED
从线14至线79(正上方的DllMain).......就是这样!
您现在可以链接到pythoncore.lib :)
伊詹