标签:comment lib defined Py LNK1104 python37 pragma
1. 找到python头文件pyconfig.h,将 # define Py_DEBUG 注释掉(330行)
330 #ifdef _DEBUG
331 #define Py_DEBUG // 将该行注释掉 332 #endif
2.找到以下代码(287行),将 pragma comment(lib,"python37_d.lib") 修改为 pragma comment(lib,"python37.lib") ,重新编译即可。
278 /* For an MSVC DLL, we can nominate the .lib files used by extensions */ 279 #ifdef MS_COREDLL 280 # if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) 281 /* not building the core - must be an ext */ 282 # if defined(_MSC_VER) 283 /* So MSVC users need not specify the .lib 284 file in their Makefile (other compilers are 285 generally taken care of by distutils.) */ 286 # if defined(_DEBUG) 287 # pragma comment(lib,"python37_d.lib") 288 # elif defined(Py_LIMITED_API) 289 # pragma comment(lib,"python3.lib") 290 # else 291 # pragma comment(lib,"python37.lib") 292 # endif /* _DEBUG */ 293 # endif /* _MSC_VER */ 294 # endif /* Py_BUILD_CORE */ 295 #endif /* MS_COREDLL */
标签:comment,lib,defined,Py,LNK1104,python37,pragma 来源: https://www.cnblogs.com/chanyuantiandao/p/16671131.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。