Skip to content
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

Failed to find library libtesseract400.dll #427

Open
ilochray opened this issue Jun 22, 2018 · 5 comments
Open

Failed to find library libtesseract400.dll #427

ilochray opened this issue Jun 22, 2018 · 5 comments

Comments

@ilochray
Copy link

I have built tesseract.dll using the code in feature/321-Tesseract-4 and used the result to build the sample console application on my Windows 10 PC. The application runs fine. I can then copy the .exe and .dll files to a different folder on my PC and the application still runs fine.
If I then copy the folder to a Windows 2012 R2 server and try to run the application it crashed with error "Failed to find library libtesseract400.dll".
I have installed the appropriate C++ runtime files and tried building in both 32 and 64 bit modes. The tesseract and leptonica libraries are in the correct location.
procmon says that libtesseract400.dll is being correctly loaded and shows no errors.
I have read issues #304 and #363 but still no success.
Do you have and more suggestions?

@ilochray
Copy link
Author

Unexpected Error: Exception has been thrown by the target of an invocation.
Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Failed to find library "libtesseract400.dll" for platform x86.
at InteropDotNet.LibraryLoader.LoadLibrary(String fileName, String platformName)
at InteropRuntimeImplementer.TessApiSignaturesInstance.TessApiSignaturesImplementation..ctor(LibraryLoader loader)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at InteropDotNet.InteropRuntimeImplementer.CreateInstanceT
at Tesseract.Interop.TessApi.Initialize()
at Tesseract.Interop.TessApi.get_Native()
at Tesseract.TesseractEngine..ctor(String datapath, String language, EngineMode engineMode, IEnumerable1 configFiles, IDictionary2 initialOptions, Boolean setOnlyNonDebugVariables)
at Tesseract.TesseractEngine..ctor(String datapath, String language, EngineMode engineMode)
at Tesseract.ConsoleDemo.Program.Main(String[] args)

@ilochray
Copy link
Author

If I rebuild the application using the old dlls (tesseract.dll (3.0.2), liblept172.dll and libtesseract304.dll) it runs correctly on Windows 10 and Windows 2012.

@charlesw
Copy link
Owner

charlesw commented Jun 23, 2018 via email

@ilochray
Copy link
Author

It's a VM running AMD processors. I noticed that issue is a previous post so, when I rebuilt tesseract.dll, I unticked the Optimize code button in the Build options. Is there something else I need to do? I noticed that another poster rebuilt libtesseract400.dll & liblept1742.dll.

@charlesw
Copy link
Owner

charlesw commented Jun 27, 2018 via email

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

No branches or pull requests

2 participants