How can I add opencv libraries to setup.py?

asked 2015-07-25 23:30:00 -0500

mayooran gravatar image

I have created an embedded Python code where a C++ function is called from Python. I have created the setup.py as following.

from distutils.core import setup,Extension

extension_mod=Extension('getGender',['getGender.cpp'],library_dirs=['/usr/local/include/opencv2/contrib','/usr/local/include/opencv2/core','/usr/local/include/opencv2/highgui','/usr/local/include/opencv2/imgproc','/usr/local/include'])

 setup(name='getGender',ext_modules=[extension_mod])

But I am getting this error.

ImportError: /usr/local/lib/python2.7/dist-packages/getGender.so: undefined symbol: _ZN2cv3Mat10deallocateEv

How can I reference these opencv libraries in my setup.py? Please advice.

edit retag flag offensive close merge delete