edmBernard / pybind11_opencv_numpy

Implementation of cv::Mat conversion to numpy.array for pybind11
Apache License 2.0
198 stars 41 forks source link

undefined symbol when testing example.cpp #2

Closed charlielam0615 closed 7 years ago

charlielam0615 commented 7 years ago

Hi, Thanks for this project! I am kind of new to exposing C++ programs to Python. I tried to test to the example.cpp in this project with the the following compiling command:

g++ -Wall -g -fPIC -std=c++11 -c -I"./pybind11_opencv_numpy/" -I"/usr/include/python2.7" example.cpp

g++ -O3 -shared -fPIC -std=c++11python-config --cflags --ldflags-L"./pybind11_opencv_numpy/"pkg-config --libs opencvexample.o -o example.so

Gave me this error when trying to import example in python: ImportError: ./example.so: undefined symbol: _ZN2cv3Mat10deallocateEv

Did I miss something when linking? What compiling commands were you guys using?

Regards, Charlie Lam

charlielam0615 commented 7 years ago

I found I need to include ndarray_converter.cpp when compiling... fixed... Sorry to bother.