Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Detected an attempt to call a symbol in system libraries that is not present on the iPhone #5

Open
Trifusion opened this issue Aug 17, 2011 · 6 comments

Comments

@Trifusion
Copy link

Getting the following error when trying to run on Simulator, runs fine of Device:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
fputs$UNIX2003 called from function _Z7tprintfPKcz in image OCRDemo.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.

Any ideas?

Thanks

Greg

@benoitcerrina
Copy link

you need to rebuild the tesseract library for iOS 4.2 or higher.
In my case I have 4.3.
I have had to make several changes to the build_fat.sh:

  1. change SDKROOT to the correct value for both iPhone and iphonesimulator
    In particular for the simulator I use
    export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
    export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.3.sdk
  2. change the compiler used to build arm to
    ./configure CXX=$DEVROOT/usr/bin/gcc-4.2 CC=$DEVROOT/usr/bin/gcc-4.2 LD=$DEVROOT/usr/bin/ld --host=arm-apple-darwin

@Trifusion
Copy link
Author

I'm not familiar with .sh scripts is there a step by step somewhere or a primer on how to write/run them?

Thanks

Greg

Sent from my iPhone

On 2011-09-29, at 6:21 PM, [email protected] wrote:

you need to rebuild the tesseract library for iOS 4.2 or higher.
In my case I have 4.3.
I have had to make several changes to the build_fat.sh:

  1. change SDKROOT to the correct value for both iPhone and iphonesimulator
    In particular for the simulator I use
    export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
    export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.3.sdk
  2. change the compiler used to build arm to
    ./configure CXX=$DEVROOT/usr/bin/gcc-4.2 CC=$DEVROOT/usr/bin/gcc-4.2 LD=$DEVROOT/usr/bin/ld --host=arm-apple-darwin

Reply to this email directly or view it on GitHub:
#5 (comment)

@benoitcerrina
Copy link

to run them just call them from the command line. You will find plenty of tutorials on the net on how to write any. In this case you just need to change the variables I mentioned.
Benoit
On Sep 30, 2011, at 1:13 AM, Trifusion wrote:

I'm not familiar with .sh scripts is there a step by step somewhere or a primer on how to write/run them?

Thanks

Greg

Sent from my iPhone

On 2011-09-29, at 6:21 PM, [email protected] wrote:

you need to rebuild the tesseract library for iOS 4.2 or higher.
In my case I have 4.3.
I have had to make several changes to the build_fat.sh:

  1. change SDKROOT to the correct value for both iPhone and iphonesimulator
    In particular for the simulator I use
    export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
    export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.3.sdk
  2. change the compiler used to build arm to
    ./configure CXX=$DEVROOT/usr/bin/gcc-4.2 CC=$DEVROOT/usr/bin/gcc-4.2 LD=$DEVROOT/usr/bin/ld --host=arm-apple-darwin

Reply to this email directly or view it on GitHub:
#5 (comment)

Reply to this email directly or view it on GitHub:
#5 (comment)

@conspiracyt
Copy link

Hi all,
I have the same problem. The tesseract works well with the iPhone device but gives me an error at the tesseract execution on the simulator. Though, I need to work on the simulator to make some changes so I need to solve this problem before going further.
In the lines you indicate we remove the arm processor commands, are we still going to be able to have a working application on the iPhone device or just the simulator?

Do I run the script build_fat.sh with a command line

./build_fat.sh
after changing those variables in build_fat.sh? Is that all?
I already did that and I still get the error from the simulator.

@benoitcerrina
Copy link

Hello,
as I mentioned the problem is in the tesseract binary provided. It is built for an earlier version of the sdk which used to decorate the simulator symbols with UNIX2003. That is the problem. Now to fix it you need to rebuild the tesseract fat library. How to do this is described quickly in the Readme file which accompanies this project and in more derail in an article which is referenced in the read me and found here: http://robertcarlsen.net/2009/07/15/cross-compiling-for-iphone-dev-884.
However if you just try to run the build_fat script as is it won't work for you since that script is meant for older versions of the sdk, you'll need to adapt it. I described how to do it. If it didn't work for you I assume your configuration is slightly different with a different sdk or a different localization for it.
One thing that isn't clear is what is failing for you, did you build a new version of the tesseract library? Are you using it? I hope you realized that you have to overwrite the libtesseract_fulll.a in OCRDemo with the one you built which should be in tesseract-2.04/lnsout

@tscung
Copy link

tscung commented Mar 23, 2012

Hi!
When I run on device, the gdb log out:"Unable to load unicharset file /var/mobile/Applications/15243799-CCDF-42BE-9834-1F14451CFE30/Documents/tessdata/eng.unicharset"
Please tell me the reason and how to fix.
When I debug, I see that code run ok: [fileManager copyItemAtPath:tessdataPath toPath:dataPath error:NULL];, it mean after that, there are eng.unicharset in document directory

Please help
Thank

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants