在Xamarin.iOS中使用OpenCV(arm64)

时间:2016-04-15 23:11:29

标签: c++ ios opencv xamarin.ios opencv3.0

我一直在努力让OpenCV用arm64在Xamarin.iOS上运行。我在opencv.org上找到的最新版本似乎不是为arm64构建的。我自己构建最新的库时遇到了麻烦,但是为OpenCV 2.4.12(https://github.com/Itseez/opencv/tree/2.4.12)进行了构建。但是,当我将库添加到我的解决方案(通过绑定库)时,我收到以下错误:

MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_free_large. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_free_small. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_get_large. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_get_small. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_mem_available. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_mem_init. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_mem_term. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5210: Native linking failed, undefined symbol: _jpeg_open_backing_store. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
    MTOUCH: error MT5202: Native linking failed. Please review the build log.

我已阅读https://github.com/twelve17/openalpr-ios/issues/5我需要链接到libjpeg。我通过使用以下mtouch命令执行此操作: -gcc_flags "-L${ProjectDir} -ljpeg -force_load ${ProjectDir}/libjpeg.a" 但是,现在我得到了重复项可用的错误:

MTOUCH:  duplicate symbol _jpeg_std_error in: 
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_CreateCompress'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_destroy_compress'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_abort_compress'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_suppress_tables'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_finish_compress'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_write_marker'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_write_m_header'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_write_m_byte'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_write_tables'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapimin.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_start_compress'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapistd.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapistd.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_write_scanlines'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapistd.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapistd.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_write_raw_data'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcapistd.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcapistd.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_c_coef_controller'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jccoefct.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jccoefct.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_color_converter'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jccolor.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jccolor.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_forward_dct'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcdctmgr.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcdctmgr.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_make_c_derived_tbl'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jchuff.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jchuff.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_gen_optimal_table'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jchuff.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jchuff.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_huff_encoder'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jchuff.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jchuff.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_compress_master'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcinit.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcinit.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_c_main_controller'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcmainct.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcmainct.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_marker_writer'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcmarker.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcmarker.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jinit_c_master_control'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcmaster.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcmaster.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_abort'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_destroy'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_alloc_quant_table'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_alloc_huff_table'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcomapi.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_add_quant_table'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_set_linear_quality'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_quality_scaling'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_set_quality'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_set_defaults'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_default_colorspace'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_set_colorspace'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_jpeg_simple_progression'.
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/obj/iPhone/Debug/mtouch-cache/opencv2.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5213: Duplicate symbol in: /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a(jcparam.o) (Location related to previous error)
    MTOUCH: error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -L/Users/Alexander/Projects/VRMouse/iOS -ljpeg -force_load /Users/Alexander/Projects/VRMouse/iOS/libjpeg.a
    MTOUCH: error MT5202: Native linking failed. Please review the build log.

3 Warning(s) 105 Error(s)

我不知道如何解决这个问题以及我哪里出错了。任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:2)

根据我从Chris Britt收到的评论,我觉得OpenCV的构建出了问题。我设法找到了iOS的预构建版本的框架。 SDK 7.1,armv7,armv7s,arm64,i386,x86_64(https://github.com/AlexeyIS/OpenCV-iOS)。即使它没有解释我做错了什么,这是一个很好的解决方法,允许我在arm64上运行OpenCV。