python2.7_d lib 无法打开

刚才用VC掉Python的脚本,Debug模式下结果报了一个错误是:‘python2.7_d lib 无法打开’
然后上网上搜了一下,有一个哥们出了一个招数就是屏蔽Python调用库的Debug模式:
修改Pythonconfig.h,按下面的示例修改。

... ...
/* For an MSVC DLL, we can nominate the .lib files used by extensions */
#ifdef MS_COREDLL
#   ifndef Py_BUILD_CORE /* not building the core - must be an ext */
#       if defined(_MSC_VER)
            /* So MSVC users need not specify the .lib file in
            their Makefile (other compilers are generally
            taken care of by distutils.) */
#           ifdef _DEBUG
#               pragma comment(lib,"python27.lib")//pragma comment(lib,"python27_d.lib")
#           else
#               pragma comment(lib,"python27.lib")
#           endif /* _DEBUG */
#       endif /* _MSC_VER */
#   endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
... ...
#ifdef _DEBUG
//# define Py_DEBUG
#endif

你可能感兴趣的:(visual-C++,python)