Webassembly VideoCapture symbol not defined errors

asked 2019-08-23 03:44:28 -0600

im_shirohige gravatar image

Hello, I built openCV js from source using these config in build_js.py

cmd = ["cmake",
               "-DCMAKE_BUILD_TYPE=Release",
               "-DCMAKE_TOOLCHAIN_FILE='%s'" % self.get_toolchain_file(),
               "-DCPU_BASELINE=''",
               "-DCPU_DISPATCH=''",
               "-DCV_TRACE=OFF",
               "-DBUILD_SHARED_LIBS=OFF",
               "-DWITH_1394=OFF",
               "-DWITH_ADE=OFF",
               "-DWITH_VTK=OFF",
               "-DWITH_EIGEN=OFF",
               "-DWITH_FFMPEG=OFF",
               "-DWITH_GSTREAMER=ON",
               "-DWITH_GTK=ON",
               "-DWITH_GTK_2_X=OFF",
               "-DWITH_IPP=OFF",
               "-DWITH_JASPER=OFF",
               "-DWITH_JPEG=OFF",
               "-DWITH_WEBP=OFF",
               "-DWITH_OPENEXR=OFF",
               "-DWITH_OPENGL=OFF",
               "-DWITH_OPENVX=OFF",
               "-DWITH_OPENNI=OFF",
               "-DWITH_OPENNI2=OFF",
               "-DWITH_PNG=OFF",
               "-DWITH_TBB=OFF",
               "-DWITH_PTHREADS_PF=OFF",
               "-DWITH_TIFF=OFF",
               "-DWITH_V4L=OFF",
               "-DWITH_OPENCL=OFF",
               "-DWITH_OPENCL_SVM=OFF",
               "-DWITH_OPENCLAMDFFT=OFF",
               "-DWITH_OPENCLAMDBLAS=OFF",
               "-DWITH_GPHOTO2=OFF",
               "-DWITH_LAPACK=OFF",
               "-DWITH_ITT=OFF",
               "-DWITH_QUIRC=OFF",
               "-DBUILD_ZLIB=ON",
               "-DBUILD_opencv_apps=OFF",
               "-DBUILD_opencv_calib3d=ON",
               "-DBUILD_opencv_dnn=ON",
               "-DBUILD_opencv_features2d=ON",
               "-DBUILD_opencv_flann=ON",  # No bindings provided. This module is used as a dependency for other modules.
               "-DBUILD_opencv_gapi=OFF",
               "-DBUILD_opencv_ml=OFF",
               "-DBUILD_opencv_photo=ON",
               "-DBUILD_opencv_imgcodecs=ON",
               "-DBUILD_opencv_shape=OFF",
               "-DBUILD_opencv_videoio=ON",
               "-DBUILD_opencv_videostab=ON",
               "-DBUILD_opencv_highgui=ON",
               "-DBUILD_opencv_superres=OFF",
               "-DBUILD_opencv_stitching=OFF",
               "-DBUILD_opencv_java=OFF",
               "-DBUILD_opencv_java_bindings_generator=OFF",
               "-DBUILD_opencv_js=ON",
               "-DBUILD_opencv_python2=OFF",
               "-DBUILD_opencv_python3=OFF",
               "-DBUILD_opencv_python_bindings_generator=OFF",
               "-DBUILD_EXAMPLES=OFF",
               "-DBUILD_PACKAGE=OFF",
               "-DBUILD_TESTS=OFF",
               "-DBUILD_PERF_TESTS=OFF"]

In my C++ program I create an object of VideoCapture class, and when I try to compile my C++ program to webassembly, It gives me the following errors

error: undefined symbol:
_ZN2cv12VideoCapture4readERKNS_12_OutputArrayE error: undefined symbol:
_ZN2cv12VideoCaptureC1ERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi error: undefined symbol:
_ZN2cv12VideoCaptureC1Ev error: undefined symbol:
_ZN2cv12VideoCaptureD1Ev error: undefined symbol:
_ZNK2cv12VideoCapture8isOpenedEv

Please tell me what am I doing wrong?

edit retag flag offensive close merge delete