Tesseract-OCR-iOS icon indicating copy to clipboard operation
Tesseract-OCR-iOS copied to clipboard

Cannot build on XCode 10, ios12

Open dCode91 opened this issue 6 years ago • 25 comments

library not found for -lstdc++.6.0.9 issue when trying to build the template project in XCode 10. As far as i read lstdc++ is not supported anymore and should be replaced with libc++

dCode91 avatar Aug 30 '18 20:08 dCode91

having the same issue but only on simulator, works on device. Did you manage to make it work?

tudor133 avatar Sep 14 '18 12:09 tudor133

Same here. Any progress so far?

Maxtws avatar Sep 14 '18 13:09 Maxtws

Libstdc++ was deprecated, the support was removed from the iOS 12 simulator but not the device, so it should work for now. This library would need to be updated to libc++. If you want to hack around this, you will need to copy the libstdc++.*dylib from the iOS 11.4 simulator runtime to the iOS 12.0 simulator runtime in addition to copying the libstdc++.tbd between the SDKs.

tudor133 avatar Sep 14 '18 14:09 tudor133

I just updated to Xcode 10 and I'm facing the same issue whenever I try to run a project that depends on Tesseract using the iOS 12 simulator.

Is there any hope that this issue will be fixed (by switching from libstdc++ to libc++) any time soon? This might turn into a bigger deal in the future if left unchecked.

Thank you.

pandraos avatar Sep 19 '18 12:09 pandraos

You could give #378 a try.

It uses tesseract-4.0.0 though so you'll need to update your tessdata.

It doesn't use libstdc++ anymore though, so it should fix your problem

hamchapman avatar Sep 19 '18 12:09 hamchapman

Thank you for the quick reply. I tried adding the following to my Podfile: pod 'TesseractOCRiOS', :git => 'git://github.com/hamchapman/Tesseract-OCR-iOS.git', :branch => 'macos-support'

...after a long pod install, I got the following error message:

[!] The platform of the target XYZ (iOS 9.3) is not compatible with TesseractOCRiOS (4.0.0), which does not support ios.

Any help would be appreciated.

EDIT: I managed to solve this issue after coming back to it a few days later. I found a pull request that addresses the problem I was having that is based on the pull request that @hamchapman linked. For anyone that might be interested, you just have to add the following to your Podfile: pod 'TesseractOCRiOS', :git => 'git://github.com/parallaxe/Tesseract-OCR-iOS.git', :branch => 'macos-support'

Thank you for the help.

pandraos avatar Sep 19 '18 17:09 pandraos

@pandraos, I have the same problem as before with the pod you’ve provided.

yeleleo avatar Sep 25 '18 22:09 yeleleo

Here is StackOverflow issue https://stackoverflow.com/questions/52331634/xcode-10-0-gm-dyld-lazy-symbol-binding-failed-cant-resolve-symbol-cxa-gu

Jnis avatar Sep 26 '18 20:09 Jnis

@yeleleo What problem are you having exactly?

pandraos avatar Sep 26 '18 20:09 pandraos

@pandraos crash on simulator (X10.iOS12)

dyld: can't resolve symbol ___cxa_guard_acquire in /Users/~/Library/Developer/CoreSimulator/Devices/EA8FFB5B-29B4-23E5-8BD4-A50F6D43A657/data/Containers/Bundle/Application/3A8D9B3A-1EDA-48A7-9A5A-F297A84A22F1/App.app/Frameworks/TesseractOCR.framework/TesseractOCR because dependent dylib #1 could not be loaded

@Jnis does not work for me (both)

yeleleo avatar Sep 26 '18 20:09 yeleleo

@yeleleo Maybe you should try clearing your CocoaPods cache, deleting your project's pods and running a fresh pod install and then testing a clean build. I hope that helps.

pandraos avatar Sep 26 '18 20:09 pandraos

@pandraos just tried, nope =(

yeleleo avatar Sep 26 '18 20:09 yeleleo

You can try this library https://github.com/SwiftyTesseract/SwiftyTesseract

yura-hb avatar Sep 27 '18 21:09 yura-hb

@yeleleo , yes, it does not work for me too. 1/ But, on device this library works well. 2/ And (stupid, but it works) you can download simulator iOS11.4 for testing on simulator. 3/ And waiting/hoping for update of this library. Or you can try another library (ex. @GaevYuriy )

Jnis avatar Sep 29 '18 17:09 Jnis

@Jnis and how you test on new devices if you don't have any?)

yeleleo avatar Sep 29 '18 18:09 yeleleo

@Jnis and how you test on new devices if you don't have any?)

I do. New devices are proven to be compatible with old (6.0.9) runtime lib. In other words iOS 12 runtime has lstdc++.6.0.9 on board.

Maxtws avatar Sep 30 '18 12:09 Maxtws

Add that command to your pod file => https://gist.github.com/gali8/7d090865a904a16caf5a7a3116c3c3ab

gali8 avatar Oct 08 '18 09:10 gali8

Hi @gali8 not helped in my case =(

yeleleo avatar Oct 08 '18 22:10 yeleleo

any new news on when this library will be updated to libc++ ?

muka459 avatar Oct 27 '18 17:10 muka459

@hamchapman @parallaxe @gali8

I can confirm that by specifying pod 'TesseractOCRiOS', :git => 'git://github.com/parallaxe/Tesseract-OCR-iOS.git', :branch => 'macos-support' in my project that I can build AND run in the Xcode 10.1/iOS 12.1 Simulator.

This allows me to run an Xcode test suite on sample images for my app in CI...

francisli avatar Dec 01 '18 22:12 francisli

Can confirm! Updating the pod branch to macos-support as stated by @francisli works perfectly. Thank you

samcasm avatar Dec 10 '18 21:12 samcasm

@samcasm @francisli Which tessdata files do you use? I had the same issue that I could not run the app on simulator but on device (using master branch with tessdata version 3.5). Now, after updating to 'macos-support' branch I need to update tessdata to 4.0 in order to avoid weird "read_params_file: parameter not found: enable_new_segsearch" issue. And then, it runs on both simulator and device BUT outputs only garbage. I need trained tessdata for german and english, that works with this branch...

taekwondoMaster avatar May 09 '19 11:05 taekwondoMaster

Doing the above solution does not work with the existing tessdata files. Which tessdata files do you have to use?

zdavatz avatar Aug 23 '19 09:08 zdavatz

This works: https://gist.github.com/gali8/7d090865a904a16caf5a7a3116c3c3ab - but it does not work on the simulator, only on the device.

zdavatz avatar Aug 23 '19 17:08 zdavatz

https://github.com/devdawei/libstdc- This repository help me add libstdc to Xcode12 by .sh. And it's also useful to Xcode10 Xcode11.

guodan avatar Mar 26 '21 06:03 guodan