Nick
Nick

Reputation: 175

undefined symbol: _ZN2cv3Mat10deallocateEv

I've been trying to extend my python script with a C++ code. I was able to do that with the simple libraries of C++ (print "hello world"). I followed the tutorial available in the link below:

http://www.tutorialspoint.com/python/python_further_extensions.htm

When I tried to add to my C++ code opencv libraries I encountered the following problem: ImportError: /usr/local/lib/python2.7/dist-packages/kalman.so: undefined symbol: _ZN2cv3Mat10deallocateEv

I searched for many solutions on the internet, and I found one common answer that didn't workout for me: "I was able to solve this by going to /usr/lib64/pkgconfig and modified opencv.pc to explicitly have all libraries. I also had to move the plugins from /usr/lib/gstreamer-0.10 to /usr/lib64/gstreamer-0.10"

Please note that I am using ubuntu 14.04 LTS 64-bit and I am planning to run my code later on on a raspberry pi model B running Raspbian OS.

Thank you.

NJ

Upvotes: 3

Views: 8703

Answers (2)

WQS
WQS

Reputation: 1

I've met the same problem as you do, and at last I figured out that this is because I didn't add the linking library of opencv when compiling. Try to add the "opencv_core" or other related library when you compile the c++ source file. Wish this to be helpful to you.

Upvotes: 0

Jacobian
Jacobian

Reputation: 10812

Check your shared library kalman.so with ldd like so:

 $ ldd kalman.so

And you will see that you are missing some libraries. That means that you have to provide some correct path to one of the libraries you use in your code at the linkage stage. something like

 $ ...the way you do linking ... -L path_to_the_missing_library

For more information, please, consult this link.

Upvotes: 1

Related Questions