gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Fix podspec for newer Xcode versions, link libz in other linker flags #234

Closed mweibel closed 9 years ago

mweibel commented 9 years ago

Might fix #233

@AngeloGiurano could you try?

AngeloGiurano commented 9 years ago

@mweibel :+1: This works!

mweibel commented 9 years ago

awesome, thanks for the reply :)

AngeloGiurano commented 9 years ago

@mweibel Thanks to You for solving the problem :)

mweibel commented 9 years ago

fyi @ws233 (updated by @gali8) when you merge this change, the section "Import libz.dylib to target" on https://github.com/gali8/Tesseract-OCR-iOS/wiki/Installation page is not needed anymore.

gali8 commented 9 years ago

@ws233 +1 Thank you!

mweibel commented 9 years ago

(o.O somehow chose the wrong person to @..., sorry ws233 in case you see it)

//Edit: or maybe not, I'm confused)

AngeloGiurano commented 9 years ago

@mweibel Thanks :dancer:

gali8 commented 9 years ago

@mweibel @ws233 is not the wrong person! :)

ws233 commented 9 years ago

Sorry for late response! @mweibel, why do you think it's not necessary anymore? The Tesseract dependency libs need it to operate correctly. I'm afraid the app cannot be linked without libz. Anyway, if it so, can you change the corresponding file and include it into the pull request?

mweibel commented 9 years ago

@ws233 np, not a late response at all :)

Beware, I'm a noob with iOS development, so take this with a grain of salt :D Apparently the -lz flag for the linker does include libz.tbd which is seemingly the new format for those libraries to be used by Xcode.. As I didn't do a "clean setup" with only what I think is necessary now I can't tell for sure though. Might do that later.

Regarding including the file in the PR: wanted to do that but apparently wiki pages aren't pull-requestable on GitHub :/

ws233 commented 9 years ago

Ok. I'll change it as soon as we confirm that this step is no longer necessary.

mweibel commented 9 years ago

@ws233 created a sample project where I didn't manually include libz: https://github.com/mweibel/test-tesseract

hiragram commented 9 years ago

I am waiting for this change on master!

JenkinsJB commented 9 years ago

Hi. I'm also waiting for this PR to be merged. Any update on a timeline or if anything else is needed? Thanks.

mweibel commented 9 years ago

@hiragram @JenkinsJB you can also, to not be blocked, in the meantime specify my github fork for the pod dependency

ws233 commented 9 years ago

@mweibel, first of all thanks for you PR.

I've checked your example project and those are other linker flags of test-tesseract target: -ObjC -l"stdc++" -l"z" -framework "TesseractOCR" As I told, libz is a dependecy of the Tesseract. Try to remove -l"z" and linking fails. Also I couldn't run your test project to confirm it's working well. Pls, correct it and if everything is ok with it, I'll merge yoiu PR.

mweibel commented 9 years ago

@ws233 not sure I understand you correctly. -lz is the 'new' libz if you like. Therefore it's specified in the other linker flags in this PR. Removing -lz: Why would I do that? I added that specificly to the other linker flags of tesseract, therefore it is needed.

Also I couldn't run your test project to confirm it's working well.

Could you elaborate?

ws233 commented 9 years ago

@mweibel, you wrote above:

the section "Import libz.dylib to target" on https://github.com/gali8/Tesseract-OCR-iOS/wiki/Installation page is not needed anymore.

I'm trying to explain that it's necessary. Some people can integrate TesseractOCR other way rather than using CocoaPods. So they need to know that they have to link libz as well. So I'm not going to remove this step from the Wiki page.

Could you elaborate?

  1. The Podfile is wrong. It contains your own path. Pls, change it to the global URL of your PR.
  2. There are at least 2 absolute paths to the tessdata folders located on your local drive. Pls, fix those paths.

I'm sorry for this, but I do not have enough time to fix this by myself this days.

I'll merge PR as soon as I can confirm everything is ok with it. The fastest way to confirm is your test-project.

mweibel commented 9 years ago

I'm trying to explain that it's necessary. Some people can integrate TesseractOCR other way rather than using CocoaPods. So they need to know that they have to link libz as well. So I'm not going to remove this step from the Wiki page.

Ah, ok makes sense. Maybe you could add a short hint that this shouldn't be needed for people using cocoapods?

The test-tesseract project should be fixed now.