Error MT5212: Native linking fail (Conflict with ffimageloading)

Post your iOS related question here.
Post Reply
kfchai
Posts: 1
Joined: Sun Jul 01, 2018 8:56 pm

Error MT5212: Native linking fail (Conflict with ffimageloading)

Post by kfchai » Sun Jul 01, 2018 9:10 pm

Dear Dev,

Just attempted to compile the project after added reference to Xamarin iOS project however these errors occurred during native lib linking. it seems like the conflict of symbols between libcvextern.a (alpha_dec.o) and WebP.a (dependency of ffimageloading) (libwebpdecode_la-alpha_dec.o)

Code: Select all

Error MT5212: Native linking failed, duplicate symbol: '_WebPDeallocateAlphaMemory'. (MT5212)
Error MT5213: Duplicate symbol in: Debug/device-builds/iphone10.3-11.4/mtouch-cache/libcvextern.a(alpha_dec.o) (Location related to previous error) (MT5213) 
Error MT5213: Duplicate symbol in: Debug/device-builds/iphone10.3-11.4/mtouch-cache/WebP.a(libwebpdecode_la-alpha_dec.o) (Location related to previous error) (MT5213) 
Is there anyway to overcome this? as ffimageloading is quite a fundamental lib for cached image. thanks!

canming
Site Admin
Posts: 1011
Joined: Thu Feb 28, 2008 4:16 pm

Re: Error MT5212: Native linking fail (Conflict with ffimageloading)

Post by canming » Wed Jul 11, 2018 3:57 pm

Hi,

The default Open CV build for iOS includes the webp library such that Open CV will be able to read image in webp format. The static lib file "libcvextern.a" therefore includes the implementation for '_WebPDeallocateAlphaMemory'. If you are using other library that also contains webp, such as ffimageloading, you will see the specific error message.

There are two ways to fix it:
1. By using the Emgu CV for iOS commercial release, apply this patch to enable smart linking.
https://github.com/emgucv/emgucv/commit ... a0a8e35561
and adding the --registrar:static mtouch arguments to your ios app project should be able to fix the problem.
SmartLinking will be enabled in the next release build, but it is not included in the current 3.4.1 release.

2. If option 1 doesn't work, we can still exclude webp in either the Emgu CV / Open CV build, or the ffimageloading build. We can provide the Emgu CV / Open CV build without webp for a fee or you can check if you can build ffimageloading without webp.

Hope that helps,

Best regards,

Canming

david.a.angel
Posts: 4
Joined: Mon Oct 22, 2018 12:10 pm

Re: Error MT5212: Native linking fail (Conflict with ffimageloading)

Post by david.a.angel » Mon Oct 22, 2018 1:18 pm

Using another library for Tesseract I get the same "duplicate" problem.
Is this the same when using another library for the Tesseract? Is there a way to use Tesseract from another library while still using Emgu.cv?
Thank you!

canming
Site Admin
Posts: 1011
Joined: Thu Feb 28, 2008 4:16 pm

Re: Error MT5212: Native linking fail (Conflict with ffimageloading)

Post by canming » Thu Oct 25, 2018 1:14 pm

The 3.4.3 iOS release has "SmartLinking" enabled, please give that release a try and also add the "--registrar:static" mtouch argument for your ios app.

Post Reply