编译OpenCV缺少python27_d.lib的解决方法
2018-02-12 14:58
344 查看
错误 24error 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中将[cpp] view plain copy#ifdef _DEBUG
# define Py_DEBUG
#endif
修改为:[cpp] view plain copy#ifdef _DEBUG
//# define Py_DEBUG
#endif
将[cpp] view plain copy/* 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_d.lib")
# else
# pragma comment(lib,"python27.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
修改为[cpp] view plain copy/* 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")
# else
# pragma comment(lib,"python27.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
在object.h中将
[cpp] view plain copy/* Py_DEBUG implies Py_TRACE_REFS. */
#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)
#define Py_TRACE_REFS
#endif
修改为[cpp] view plain copy/* Py_DEBUG implies Py_TRACE_REFS. */
#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)
//#define Py_TRACE_REFS
#endif
保存之后,再次编译就成功啦!
转载来源:http://blog.csdn.net/pplxlee/article/details/78067927
一个妥协的方法是注释掉会使用python27_d.lib部分的代码,替换为使用python27.lib
具体做法如下:在OpenCV项目的bindings中的opencv_python项目中,点击“外部依赖项”,在其中找到pyconfig.h和object.h文件:在pyconfig.h中将[cpp] view plain copy#ifdef _DEBUG
# define Py_DEBUG
#endif
修改为:[cpp] view plain copy#ifdef _DEBUG
//# define Py_DEBUG
#endif
将[cpp] view plain copy/* 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_d.lib")
# else
# pragma comment(lib,"python27.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
修改为[cpp] view plain copy/* 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")
# else
# pragma comment(lib,"python27.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
在object.h中将
[cpp] view plain copy/* Py_DEBUG implies Py_TRACE_REFS. */
#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)
#define Py_TRACE_REFS
#endif
修改为[cpp] view plain copy/* Py_DEBUG implies Py_TRACE_REFS. */
#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)
//#define Py_TRACE_REFS
#endif
保存之后,再次编译就成功啦!
转载来源:http://blog.csdn.net/pplxlee/article/details/78067927
相关文章推荐
- 编译OpenCV缺少python27_d.lib的解决方法
- 缺少Python27_d.lib的解决方法
- 缺少Python27_d.lib的解决方法
- 缺少Python27_d.lib的解决方法
- 关于opencv3.1编译的时候找不到python的lib的解决方法
- 缺少Python27_d.lib的解决方法
- Python3: import matplotlib.pyplot as plt 缺少tkinter的解决方法和matplotlib实例(Fedora 27)
- 解决编译pycaffe时候出现缺少Python27_d.lib的解决方案
- python使用matplotlib缺少库文件的解决方法
- cx_freeze 打包 python 程序 缺少 vc 运行库的解决方法
- ASP编程中的"Microsoft JScript 编译错误 错误 '800a03ec'缺少;"的解决方法.
- lib_clapack.a(dlasyf.o): could not read symbols: File in wrong format---- 交叉编译opencv2.0遇到的错误解决
- Linux 编译报错 -- undefined reference to 问题解决方法 (具体'pthread_create'和opencv看文章最后两条)
- Linux 编译报错 -- undefined reference to 问题解决方法 (具体'pthread_create'和opencv看文章最后两条)
- 使用ASIHTTPRequest 编译提示找不到"libxml/HTMLparser.h"的解决方法
- Visual C++ 2012 Express 缺少windows 系统lib库解决方法
- libnids 在VS 2010中使用方法及编译错误解决方法
- 编译驱动报错缺少bounds.h的解决方法
- Android编译Libwebcore出错解决方法
- ASP编程中的"Microsoft JScript 编译错误 错误 '800a03ec'缺少;"的解决方法.