#include <Python.h>后,报LINK : fatal error LNK1104: cannot open file ‘python25_d.lib’
解决办法:
#ifdef _DEBUG
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif
原因是,编译链接过程,依赖了debug版本的pyhon库;用宏定义办法解除依赖debug库。
【原文首发】

本文介绍了解决在使用C语言开发Python扩展模块时遇到的编译链接错误:LINK:fatalerrorLNK1104:cannotopenfile‘python25_d.lib’。通过宏定义来解除对debug版本Python库的依赖,成功解决了该问题。
1862

被折叠的 条评论
为什么被折叠?



