编译OpenCV缺少python27_d.lib的解决方法
错误 24 error LNK1104: 无法打开文件“python27_d.lib” C:\OpenCV\VS2013_64\modules\python\LINK opencv_python
一个妥协的方法是注释掉会使用python27_d.lib部分的代码,替换为使用python27.lib
具体做法如下:
在OpenCV项目的bindings中的opencv_python项目中,点击“外部依赖项”,在其中找到pyconfig.h和object.h文件:
在pyconfig.h中
将
#ifdef _DEBUG
# define Py_DEBUG
#endif
修改为:
#ifdef _DEBUG
//# define Py_DEBUG
#endif
将
/* 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 intheir Makefile (other compilers are generallytaken care of by distutils.) */
# ifdef _DEBUG
# pragma comment(lib,"python27_d.lib")
# else
# pragma comment(lib,"python27.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
修改为
/* 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 intheir Makefile (other compilers are generallytaken care of by distutils.) */
# ifdef _DEBUG
# pragma comment(lib,"python27.lib")
# else
# pragma comment(lib,"python27.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
在 object.h中
将
/* Py_DEBUG implies Py_TRACE_REFS. */
#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)
#define Py_TRACE_REFS
#endif
修改为
/* Py_DEBUG implies Py_TRACE_REFS. */
#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)
//#define Py_TRACE_REFS
#endif
保存之后,再次编译就成功啦!
编译OpenCV缺少python27_d.lib的解决方法相关推荐
- vs2015 python不兼容_vs2015安装失败 缺少Python27_d.lib的解决方法
简介最近在调用caffe的python接口训练网络,需要进到caffe代码中调试,编译时需要用Python27_d.lib.Python27_d.dll. junparadox 2016年09月29日 ...
- 缺少Python27_d.lib的解决方法
修改 pyconfig.h 修改 #ifdef _DEBUG # define Py_DEBUG #endif 为 #ifdef _DEBUG //# define Py_DEBUG #endif 修 ...
- opencv编译笔记(opencv 4.1.0 编译失败缺少opencv_world410d.lib)
问题: https://blog.csdn.net/ezhchai/article/details/80557936 https://zhuanlan.zhihu.com/p/62416504 按照以 ...
- linux 安装程序丢失链接动态库,Linux安装软件过程中提示缺少动态链接库.so的解决方法...
Linux在安装软件的时候有时会出现错误,提示缺少动态链接库.so,该问题是由什么原因导致的呢? 情况分析: 1.缺少动态连接库.so-cannot open shared object file:N ...
- 编译ORB-SLAM2遇到的问题及解决方法
编译ORB-SLAM2遇到的问题及解决方法 萌新复现ORB-SLAM2 将遇到的问题记录下来便于下次复现 参照的博客是https://blog.csdn.net/wang_yifan_/article ...
- c++:dll缺少依赖文件的解决方法
c++:dll缺少依赖文件的解决方法 在A电脑上编译的dll可以在A运行,但是到B就不能运行了, 多数情况下是因为dll依赖于一些文件,这些文件存在于A,但是不存在于B. 所以我们需要在A上找到dll ...
- vivado编译出错 [Synth 8-729] [Synth 8-787]解决方法
vivado编译出错 [Synth 8-729] [Synth 8-787]解决方法 问题:在VIVADO中通过对已有功能的裁剪,生成需要的IP核,并在另一个工程中调用,进一步封装,但出现编译错误,提 ...
- DotNet Core 2.2 MVC Razor 页面编译为 View.dll 文件的解决方法
DotNet Core 2.2 MVC Razor 页面编译为 View.dll 文件的解决方法 参考文章: (1)DotNet Core 2.2 MVC Razor 页面编译为 View.dll 文 ...
- dpkg安装deb缺少依赖包的解决方法
dpkg安装deb缺少依赖包的解决方法 参考文章: (1)dpkg安装deb缺少依赖包的解决方法 (2)https://www.cnblogs.com/horizonli/p/5179224.html ...
- 玩游戏计算机丢失msvcp,Win10系统玩吃鸡提示游戏缺少msvcp140.dll的解决方法
最近有位win10系统用户反映,电脑运行吃鸡游戏的时候,系统弹出提示:"无法启动此程序,因为计算机中丢失msvcp140.dll,尝试重新安装该程序以解决此问题.",其实这是win ...
最新文章
- Strom序列化机制
- 入门到放弃node系列之网络模块(二)
- 全面异步化:淘宝反应式架构升级探索
- Java中String 和StringBuffer的区别
- 佳明245接收微信消息
- 【转】什么是CORS
- uva11609(组合数学,快速幂)
- pythondd_一些PYTHON :D:D:D
- 年薪50万的程序员_985程序员年薪50万,看似风光,但当事人却想转行
- python : itertools 中的 islice : 获取迭代器结果的切片,消耗迭代器
- java中间==、equals和hashCode差额
- Springboot中如何在Utils类中使用@Autowired注入bean
- mysql覆盖索引和回表
- 数学建模算法与应用:预测算法(4)马尔可夫预测
- 上海航芯 | 智能网联汽车终端T-BOX应用方案
- Canon iC MF8350Cdn打印机驱动安装,解决内存不能为written问题
- python爬虫基本思路
- html显示在最上,让DIV对象显示在最上层
- write、read
- 阡陌路 - 自动档车的开法(转)