Code Monkey home page Code Monkey logo

Comments (9)

kevincon avatar kevincon commented on June 26, 2024

Are you using Cocoa Pods or did you add the framework manually? If you're using Cocoa Pods, are you using version 2.2 of the library or the latest from the Github repo?

from tesseract-ocr-ios.

jsb04 avatar jsb04 commented on June 26, 2024

I downloaded the zip from github and drag & dropped TesseractOCR.framework into my project. I tried using Cocoapods earlier but I haven't used cocoapods before and it didn't seem to add the framework to my project and I wasn't sure the problem was. Which would you recommend ?

from tesseract-ocr-ios.

kevincon avatar kevincon commented on June 26, 2024

Definitely the easiest method is to use CocoaPods (I'd recommend the development version of the Tesseract wrapper library for now since it has more functionality, just the one downside that it won't work with the iPhone 5S and newer simulators). See the README in this repo for the right line to add to your Podfile.

Also make sure after running "pod install" to install the Tesseract library you open the ".xcworkspace" file instead of the ".xcodeproject". The framework will appear in the new Pods subproject in the workspace, and it will be automatically configured so everything should just work in your project if you add #import <TesseractOCR/TesseractOCR.h> to the header file of wherever you're trying to use the library in your project.

I highly recommend following the CocoaPods guide if you're new to CocoaPods: http://guides.cocoapods.org/using/using-cocoapods.html

If you want to manually add the framework to your project, make sure you also follow the other instructions listed in the README in this repo for manually adding the framework to the project. In particular, I believe the errors you are getting are a result of not linking in the "libstdc++.6.0.9.dylib" library. But again, see the README and make sure you've followed all of those instructions.

from tesseract-ocr-ios.

jsb04 avatar jsb04 commented on June 26, 2024

Thanks Kevin, I've been working through things. The problem with cocopods seems to be that when I run Pods Install I get this error:
Analyzing dependencies
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory - /Users/Josh/.cocoapods/repos (Errno::ENOENT)
I haven't been able to find a way to fix that - any suggestions?

from tesseract-ocr-ios.

kevincon avatar kevincon commented on June 26, 2024

Try following the suggestion in the comment on this Stack Overflow post: http://stackoverflow.com/questions/26990057/cocoapods-commands-fail-due-to-no-such-file-or-directory-dir-initialize-us

from tesseract-ocr-ios.

jsb04 avatar jsb04 commented on June 26, 2024

Thanks again Kevin, once I fixed up the cocoa pods specs repository issue I was able to successfully read my first image. Had to create a bridging header for swift and import the lib like this:
#import "../Pods/Headers/Public/TesseractOCRiOS/TesseractOCR.h"
which while it worked I wondered if there should had been a path added somewhere that wasn't setup correctly?

from tesseract-ocr-ios.

kevincon avatar kevincon commented on June 26, 2024

So #import <TesseractOCR/TesseractOCR.h> in the bridging header doesn't work but the relative path import does work? If so, yeah that sounds like a path-related issue. I have not used Swift with CocoaPods before, but this blog post suggests that what you did is all you have to do: https://medium.com/@stigi/swift-cocoapods-da09d8ba6dd2

Now that CocoaPods is cooperating, you could try nuking your current project and starting over from a fresh project/folder (using the CocoaPod from the get-go) to see if the issue persists.

from tesseract-ocr-ios.

jsb04 avatar jsb04 commented on June 26, 2024

Yeah, the relative path worked fine. I started the project from scratch once cocoa pods was working so guess I'll just live with it how it is. Thanks for your help.

from tesseract-ocr-ios.

kevincon avatar kevincon commented on June 26, 2024

Okay, I'm glad you got it working. Could you close this issue when you get a chance?

from tesseract-ocr-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.