-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't build project after adding framework #66
Comments
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? |
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 ? |
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 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. |
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: |
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 |
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: |
So 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. |
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. |
Okay, I'm glad you got it working. Could you close this issue when you get a chance? |
I've added the framework to a new x code 6.1 project targeting iPhone with objective C and tried to build it for iphone5 simulator but - but I still get build issues I can't seem to solve or avoid. Log below. Ultimately I'd like to use it in an iPad app with swift but from another issue I thought the above configuration would be the easiest way to get started initially. How can I solve these issues?
Thanks
Josh
Ld /Users/Josh/Library/Developer/Xcode/DerivedData/ClubMembership-fqjdchajssebyhdwivvuwtxvclnu/Build/Products/Debug-iphonesimulator/ClubMembership.app/ClubMembership normal i386
cd /Users/Josh/Documents/ClubMembership
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/Josh/Library/Developer/Xcode/DerivedData/ClubMembership-fqjdchajssebyhdwivvuwtxvclnu/Build/Products/Debug-iphonesimulator -F/Users/Josh/Library/Developer/Xcode/DerivedData/ClubMembership-fqjdchajssebyhdwivvuwtxvclnu/Build/Products/Debug-iphonesimulator -F/Users/Josh/Documents/ClubMembership -filelist /Users/Josh/Library/Developer/Xcode/DerivedData/ClubMembership-fqjdchajssebyhdwivvuwtxvclnu/Build/Intermediates/ClubMembership.build/Debug-iphonesimulator/ClubMembership.build/Objects-normal/i386/ClubMembership.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -framework TesseractOCR -Xlinker -dependency_info -Xlinker /Users/Josh/Library/Developer/Xcode/DerivedData/ClubMembership-fqjdchajssebyhdwivvuwtxvclnu/Build/Intermediates/ClubMembership.build/Debug-iphonesimulator/ClubMembership.build/Objects-normal/i386/ClubMembership_dependency_info.dat -o /Users/Josh/Library/Developer/Xcode/DerivedData/ClubMembership-fqjdchajssebyhdwivvuwtxvclnu/Build/Products/Debug-iphonesimulator/ClubMembership.app/ClubMembership
Undefined symbols for architecture i386:
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::find(char, unsigned long) const", referenced from:
tesseract::TessLangModel::IsLeadingPunc(int) in TesseractOCR
tesseract::TessLangModel::IsTrailingPunc(int) in TesseractOCR
tesseract::TessLangModel::IsDigit(int) in TesseractOCR
tesseract::WordSizeModel::Init(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in TesseractOCR
"std::1::basic_string<char, std::1::char_traits, std::1::allocator >::compare(char const) const", referenced from:
tesseract::CubeObject::Recognize(tesseract::LangModel, bool) in TesseractOCR
tesseract::CubeRecoContext::Load(tesseract::TessdataManager, UNICHARSET) in TesseractOCR
tesseract::CubeSearchObject::CubeSearchObject(tesseract::CubeRecoContext, tesseract::CharSamp) in TesseractOCR
tesseract::CubeSearchObject::CubeSearchObject(tesseract::CubeRecoContext, tesseract::CharSamp) in TesseractOCR
tesseract::CubeSearchObject::CharSample(int, int) in TesseractOCR
tesseract::CubeTuningParams::Load(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in TesseractOCR
tesseract::TessLangModel::TessLangModel(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, bool, tesseract::TessdataManager, tesseract::CubeRecoContext) in TesseractOCR
...
"std::__1::__vector_base_common::__throw_length_error() const", referenced from:
void std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::__push_back_slow_path<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) in TesseractOCR
std::__1::vector<float, std::__1::allocator >::vector(unsigned long, float const&) in TesseractOCR
std::__1::vector<float, std::__1::allocator >::vector(unsigned long) in TesseractOCR
std::__1::vector<float, std::__1::allocator >::__append(unsigned long, float const&) in TesseractOCR
std::__1::vector<tesseract::NeuralNet*, std::__1::allocatortesseract::NeuralNet* >::__append(unsigned long, t
The text was updated successfully, but these errors were encountered: