如何为android编译opencv gstreamer插件?
我试图从对android有害的gst插件中编译opencv gstreamer插件。我按照上的说明使用cerbero构建了gstreamer。我下载并编译了适用于android的opencv v3.4.6(我也尝试了许多其他版本,但问题总是一样),并将生成的opencv.pc添加到pkg配置路径(以及opencv2目录添加到标准路径…/arm64/include/gstreamer-1.0)。为了节省一些时间,我还修改了makefile.am,只编译了一个插件gstcvdilate.cpp:如何为android编译opencv gstreamer插件?,android,opencv,plugins,gstreamer,Android,Opencv,Plugins,Gstreamer,我试图从对android有害的gst插件中编译opencv gstreamer插件。我按照上的说明使用cerbero构建了gstreamer。我下载并编译了适用于android的opencv v3.4.6(我也尝试了许多其他版本,但问题总是一样),并将生成的opencv.pc添加到pkg配置路径(以及opencv2目录添加到标准路径…/arm64/include/gstreamer-1.0)。为了节省一些时间,我还修改了makefile.am,只编译了一个插件gstcvdilate.cpp: p
plugin_LTLIBRARIES = libgstopencv.la
#CXXFLAGS += -xc++ -lstdc++ -shared-libgcc -fexceptions
CXXFLAGS += -frtti -fexceptions
# sources used to compile this plug-in
libgstopencv_la_SOURCES = gstcvdilate.cpp #gstopencv.cpp
libgstopencv_la_CXXFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) $(OPENCV_CFLAGS) \
-DGST_HAAR_CASCADES_DIR=\"$(pkgdatadir)/@GST_API_VERSION@/opencv_haarcascades\"
# flags used to compile this facedetect
# add other _CFLAGS and _LIBS as needed
#
# override CV_INLINE: GLib will take care of defining 'inline' sufficiently and
# OpenCV's define isn't good enough to avoid 'unused' gcc warnings (at v2.1.0)
libgstopencv_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_CFLAGS) $(OPENCV_CFLAGS) \
-DCV_INLINE="static inline" \
-DCV_NO_BACKWARD_COMPATIBILITY
libgstopencv_la_LIBADD = \
$(top_builddir)/gst-libs/gst/opencv/libgstopencv-$(GST_API_VERSION).la \
$(GST_LIBS) $(GST_BASE_LIBS) $(OPENCV_LIBS) \
$(GSTPB_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) -lstdc++
libgstopencv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstopencv_la_LIBTOOLFLAGS = --tag=disable-static
# headers we need but don't want installed
noinst_HEADERS = gstcvdilate.h gstcvdilateerode.h
opencv_haarcascadesdir = $(pkgdatadir)/$(GST_API_VERSION)/opencv_haarcascades
opencv_haarcascades_DATA = fist.xml palm.xml
EXTRA_DIST = $(opencv_haarcascades_DATA)
但是当我尝试用make
编译这个插件时,它总是会出现这个错误(如果我尝试更多的插件,就会出现更多的链接器错误):
有人能帮我吗?我已经试着编译opencv插件一个月了,但是运气不好。提前谢谢
[cerbero-android-arm64] root@ubuntu-virtualbox:/usr/cerbero/gst-plugins-bad/ext/opencv# make
CXX libgstopencv_la-gstcvdilate.lo
CXXLD libgstopencv.la
clang++: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
.libs/libgstopencv_la-gstcvdilate.o: In function `gst_cv_dilate_get_type_once()':
/usr/cerbero/gst-plugins-bad/ext/opencv/gstcvdilate.cpp:68: undefined reference to `gst_cv_dilate_erode_get_type'
.libs/libgstopencv_la-gstcvdilate.o: In function `__clang_call_terminate':
gstcvdilate.cpp:(.text.__clang_call_terminate[__clang_call_terminate]+0x4): undefined reference to `__cxa_begin_catch'
gstcvdilate.cpp:(.text.__clang_call_terminate[__clang_call_terminate]+0x8): undefined reference to `std::terminate()'
.libs/libgstopencv_la-gstcvdilate.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:905: libgstopencv.la] Error 1