The dylib, a native shared library, should be in the system path, not
classpath, as classpath is for Java class and JAR files.
What is the exact name of your dylib by the way?
On Monday, November 18, 2013 4:09:31 AM UTC-6, fontecha wrote:
>
> Hi Quan.
>
> I installed tesseract with brew:
> brew install tesseract --all-languages
>
>
> The library is in the system path /usr/local/lib/ and I added it to the
> classpath in the eclipse project
>
>
> Command line mode works fine, but when I try to work with tess4j the
> exception I found is :
> java.lang.UnsatisfiedLinkError: Error looking up function
> 'TessBaseAPICreate': dlsym(0x7f942aa0b910, TessBaseAPICreate): symbol not
> found
>
> I'm debugging tess4j code and when I launch
> net.sourceforge.tess4j.TessAPI1Test.testTessBaseAPIRect the exception is
> launched when invokes
> this.peer = library.getSymbolAddress(functionName);
> -->[com.sun.jna.NativeLibrary.getSymbolAddress("TessBaseAPICreate")]
>
>
> Full trace :
> java.lang.UnsatisfiedLinkError: Error looking up function
> 'TessBaseAPICreate': dlsym(0x7fb932a1e4e0, TessBaseAPICreate): symbol not
> found
> at com.sun.jna.Function.<init>(Function.java:208)
> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:536)
> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:513)
> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:499)
> at com.sun.jna.Native.register(Native.java:1509)
> at com.sun.jna.Native.register(Native.java:1396)
> at com.sun.jna.Native.register(Native.java:1156)
> at net.sourceforge.tess4j.TessAPI1.<clinit>(TessAPI1.java:37)
> at net.sourceforge.tess4j.TessAPI1Test.setUp(TessAPI1Test.java:57)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
>
>
>
>
> Also I've wrote this test code :
> TessAPI api = (TessAPI) Native.loadLibrary("tesseract, TessAPI.class);
> api.TessVersion();
>
> The first line doesn't throw exception ( it makes me think library is
> found and loaded), but the second line throws similar exception:
>
> java.lang.UnsatisfiedLinkError: Error looking up function 'TessVersion':
> dlsym(0x7fb0b1a16fc0, TessVersion): symbol not found
> at com.sun.jna.Function.<init>(Function.java:208)
> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:536)
> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:513)
> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:499)
> at com.sun.jna.Library$Handler.invoke(Library.java:199)
>
> ...
>
>
>
> Thank you for any help you can provide
>
>
>
>
>
>
>
> El sábado, 16 de noviembre de 2013 00:58:03 UTC+1, Quan Nguyen escribió:
>>
>> Do you get or have libtesseract.dylib in your system path?
>>
>> On Friday, November 15, 2013 6:29:14 AM UTC-6, fontecha wrote:
>>>
>>> I have the same problem.
>>> Do you find any solution or workarround?
>>>
>>> Thanks.
>>>
>>> El miércoles, 10 de julio de 2013 11:52:29 UTC+2, Masiar escribió:
>>>>
>>>> Hello, I installed Tesseract and all the stuff on my Mac. By running
>>>> via terminal the command apparently it works.
>>>> I'm trying to run it from Eclipse (following one of the examples on the
>>>> website), but I receive the following error:
>>>>
>>>> Exception in thread "main" java.lang.UnsatisfiedLinkError: Error
>>>> looking up function 'TessBaseAPICreate': dlsym(0x7fb714d3db20,
>>>> TessBaseAPICreate): symbol not found
>>>>
>>>> at com.sun.jna.Function.<init>(Function.java:179)
>>>>
>>>> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:391)
>>>>
>>>> at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:371)
>>>>
>>>> at com.sun.jna.Library$Handler.invoke(Library.java:205)
>>>>
>>>> at com.sun.proxy.$Proxy12.TessBaseAPICreate(Unknown Source)
>>>>
>>>> at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
>>>>
>>>> at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
>>>>
>>>> at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
>>>>
>>>> at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
>>>>
>>>> at AccountCreator.decrypt(AccountCreator.java:177)
>>>>
>>>> at AccountCreator.submittingForm(AccountCreator.java:100)
>>>>
>>>> at AccountCreator.<init>(AccountCreator.java:197)
>>>>
>>>> at Main.main(Main.java:5)
>>>>
>>>>
>>>> What can I do to solve this issue? Anybody has an idea?
>>>>
>>>> Thanks a lot!
>>>>
>>>
--
--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en
---
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.