renatoGarcia / opencv-swig

SWIG interface files for OpenCV types.
Other
94 stars 23 forks source link

Error: Unable to find 'opencv2/core/version.hpp' #19

Closed TailyDuan closed 4 years ago

TailyDuan commented 5 years ago

I run swig -I/home/ubuntu64/swig_libs -c++ -python my_lib.i, but show these error, why?

swig -I/home/ubuntu64/swig_libs -c++ -python my_lib.i

/home/ubuntu64/swig_libs/opencv/detail/range.i:12: Error: Unable to find 'opencv2/core/version.hpp' /home/ubuntu64/swig_libs/opencv/detail/common.i:55: Error: Unable to find 'opencv2/core/version.hpp' /home/ubuntu64/swig_libs/opencv/detail/matx.i:12: Error: Unable to find 'opencv2/core/version.hpp' /home/ubuntu64/swig_libs/opencv/detail/vec.i:12: Error: Unable to find 'opencv2/core/version.hpp' /home/ubuntu64/swig_libs/opencv/detail/point.i:12: Error: Unable to find 'opencv2/core/version.hpp'

LaurisZhu commented 5 years ago

I met the same question. Do you have any solution? I ran it in the windows @TailyDuan

siriusdemon commented 5 years ago

添加 opencv的路径

swig -I/home/mory/projects/opencv-swig/lib -c++ `pkg-config --cflags opencv` -python interface.i 
ghost commented 4 years ago

添加 opencv的路径

swig -I/home/mory/projects/opencv-swig/lib -c++ `pkg-config --cflags opencv` -python interface.i 

I am getting the same error even if I use the same command suggested by you.

swig -c++ -python -Iopencv-swig/lib/ pkg-config --cflags opencv file.i

siriusdemon commented 4 years ago

Try

`pkg-config --cflags opencv`

instead of

pkg-config --cflags opencv
ghost commented 4 years ago

@siriusdemon Yes I did that only. I found the solution that we need to specify the path for opencv2 i.e. /usr/include (in case of linux).

swig -c++ -python -Iopencv-swig/lib -I/usr/include `pkg-config --cflags opencv` file.i
renatoGarcia commented 4 years ago

@TailyDuan, has this solution worked for you?