Debug 版的 C/C++ Python 扩展模块链接错误:Error LNK1104 cannot open file 'python35_d.lib'

来源:互联网 发布:淘宝直播卖的东西好吗 编辑:程序博客网 时间:2024/06/05 18:31

LNK1104: cannot open file ‘python34_d.lib’
http://answers.opencv.org/question/68148/lnk1104-cannot-open-file-python34_dlib/

There is an ugly workaround, but there must be a better way. Anyway, the fix is to change the hardcoded DEFAULTLIB on line 325 of pyconfig.h to use the release lib. This is actually someone else’s idea, but I can’t find that post any more.

# if defined(_DEBUG)//# pragma comment(lib,"python34_d.lib")# pragma comment(lib,"python34.lib") // no debug lib in python distribution# elif ...

It is also necessary to undefine Py_DEBUG on line 370 to avoid link errors:

#ifdef _DEBUG//# define Py_DEBUG#endif
0 0
原创粉丝点击