tesseract icon indicating copy to clipboard operation
tesseract copied to clipboard

Failed to find library \"liblept172.dll\" for platform x64.

Open hh23485 opened this issue 8 years ago • 12 comments

I reinstalled the Visual Studio 2013, but I found that all the project throw the error "Failed to find library "liblept172.dll" for platform x64." , including the sample project. So I want to know how to deal with it . I am sure the liblept172.dll is in the project debug or release folder

hh23485 avatar Apr 04 '16 02:04 hh23485

You'll need to install the VS 2015 runtime (see readme) for version 3.*. On 4 Apr 2016 04:49, "hh23485" [email protected] wrote:

I reinstalled the Visual Studio 2013, but I found that all the project throw the error "Failed to find library "liblept172.dll" for platform x64." , including the sample project. So I want to know how to deal with it . I am sure the liblept172.dll is in the project debug or release folder

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/charlesw/tesseract/issues/263

charlesw avatar Apr 04 '16 07:04 charlesw

Hi Charles is there anyway of getting around this? I can't install anything on the server hosting my app as I don't have control of that server. what options would I have. You help is greatly appreciated.

siamealinani avatar May 23 '16 10:05 siamealinani

No there's no way around this. Tesseract is a native library, in this case compiled by VS, and therefore requires the vs runtime to be installed and the app must also be run with full trust.

If a different version of VS runtime is available on the server you may be able to either compile Tesseract yourself targeting that version of the runtime. On 23 May 2016 11:53, "Alinani Siame" [email protected] wrote:

Hi Charles is there anyway of getting around this? I can't install anything on the server hosting my app as I don't have control of that server. what options would I have. You help is greatly appreciated.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/charlesw/tesseract/issues/263#issuecomment-220948715

charlesw avatar May 23 '16 14:05 charlesw

Thanks for you reply and advise. I managed to get the hosting company to install the 2015 runtime and my app is now working fine :) thanks again

siamealinani avatar May 24 '16 07:05 siamealinani

Hi, I have the same problem,but only on server. In local there is no problem with Tesseract 3, but when i publish my project on server and try to run it, server return this problem "Message :Failed to find library "liblept172.dll" for platform x86." and the ocr fail. With Tesseract2 the software work on server and local both, but Tesseract3 won't work on server. What type of fixes are needed? Thank's and sorry for the bad english

simonedis90 avatar Oct 17 '16 08:10 simonedis90

Have you checked out the corresponding page on the wiki (https://github.com/charlesw/tesseract/wiki/Error-2)?

If it's working locally but not on the server I'd say it's Environment related rather than an issue with your project. For server environments I'd make sure that:

  1. VS 2015 Runtime is installed (x86 in this case).
  2. That your app is running in full trust.

If this doesn't work then enable the Tesseract diagnostic source (see wiki) and check the windows event log for binding errors (see google :)). These should provide some clarity on exactly what is going on.

charlesw avatar Oct 17 '16 08:10 charlesw

Thank's. I hope that will solve all problems

simonedis90 avatar Oct 17 '16 11:10 simonedis90

You need to install microsoft visual c ++ 2015 redistributable package (32-64 bit)

ngocphan123 avatar Jun 13 '17 09:06 ngocphan123

Unable to install 2015 when a later version is already installed

[28DC:3AE8][2017-06-19T11:11:16]i001: Burn v3.7.3813.0, Windows v10.0 (Build 14393: Service Pack 0), path: D:\tools\visual Studio 2015 C++ redistributable\vc_redist.x64.exe, cmdline: '' [28DC:3AE8][2017-06-19T11:11:16]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\marco\AppData\Local\Temp\dd_vcredist_amd64_20170619111116.log' [28DC:3AE8][2017-06-19T11:11:16]i000: Setting string variable 'WixBundleOriginalSource' to value 'D:\tools\visual Studio 2015 C++ redistributable\vc_redist.x64.exe' [28DC:3AE8][2017-06-19T11:11:16]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'D:\tools\visual Studio 2015 C++ redistributable' [28DC:3AE8][2017-06-19T11:11:16]i000: Setting string variable 'WixBundleName' to value 'Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23026' [28DC:3AE8][2017-06-19T11:11:16]i100: Detect begin, 10 packages [28DC:3AE8][2017-06-19T11:11:16]i000: File search: windows_uCRT_DetectKey, did not find path: C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll [28DC:3AE8][2017-06-19T11:11:16]i000: File search: windows_uCRT_DetectKeyExists, did not find path: C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll [28DC:3AE8][2017-06-19T11:11:16]i000: Setting numeric variable 'windows_uCRT_DetectKeyExists' to value 0 [28DC:3AE8][2017-06-19T11:11:16]i102: Detected related bundle: {f1e7e313-06df-4c56-96a9-99fdfd149c51}, type: Upgrade, scope: PerMachine, version: 14.10.25008.0, operation: Downgrade [28DC:3AE8][2017-06-19T11:11:16]i108: Detected compatible package: vcRuntimeMinimum_x64, provider: Microsoft.VS.VC_RuntimeMinimumVSU_amd64,v14, installed: {8D50D8C6-1E3D-3BAB-B2B7-A5399EA1EBD1}, version: 14.10.25008, chained: {0D3E9E15-DE7A-300B-96F1-B4AF12B96488} [28DC:3AE8][2017-06-19T11:11:16]i103: Detected related package: {8D50D8C6-1E3D-3BAB-B2B7-A5399EA1EBD1}, scope: PerMachine, version: 14.10.25008.0, language: 0 operation: Downgrade [28DC:3AE8][2017-06-19T11:11:16]i108: Detected compatible package: vcRuntimeAdditional_x64, provider: Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14, installed: {C668F044-4825-330D-8F9F-3CBFC9F2AB89}, version: 14.10.25008, chained: {BC958BD2-5DAC-3862-BB1A-C1BE0790438D} [28DC:3AE8][2017-06-19T11:11:16]i103: Detected related package: {C668F044-4825-330D-8F9F-3CBFC9F2AB89}, scope: PerMachine, version: 14.10.25008.0, language: 0 operation: Downgrade [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false. [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: vcRuntimeMinimum_x64, state: Obsolete, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: vcRuntimeAdditional_x64, state: Obsolete, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: Windows81_x86, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: Windows81_x64, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: Windows8_x86, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: Windows8_x64, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: Windows7_MSU_x86, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: Windows7_MSU_x64, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: WindowsVista_MSU_x86, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i101: Detected package: WindowsVista_MSU_x64, state: Absent, cached: None [28DC:3AE8][2017-06-19T11:11:16]i052: Condition 'VersionNT64 >= v6.0 OR (VersionNT64 = v5.2 AND ServicePackLevel >= 1)' evaluates to true. [28DC:3AE8][2017-06-19T11:11:16]i199: Detect complete, result: 0x0 [28DC:0374][2017-06-19T11:11:19]e000: Error 0x80070666: Cannot install a product when a newer version is installed.

sentient avatar Jun 19 '17 18:06 sentient

Because you have installed a higher version than 2015, you check the microsoft visual c ++ redistributable on the machine you have installed is how much version

ngocphan123 avatar Jun 22 '17 03:06 ngocphan123

I am facing the same problem with one of my coded ui project. it is giving below exception:

System.Reflection.TargetInvocationException HResult=0x80131604 Message=Exception has been thrown by the target of an invocation. Source=mscorlib StackTrace: 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.LeptonicaApi.Initialize() 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 Stelallar2.Utils.OCR.OCRRead(String path) in D:\StellarReports\StellarReports\Stellar.Utils\Stellar.Utils\OCR.cs:line 14 at StellarReports.Test.StellarReports.stReports() in D:\StellarReports\StellarReports\Stellar.Test\StellarReports2.Test\StellarReports.cs:line 68

Inner Exception 1: DllNotFoundException: Failed to find library "liblept171.dll" for platform x86.

I have visual c++ installed, both x86 and x64 folders are present in output directories. Still i am getting the this error message.

khisalvenus avatar Oct 31 '18 11:10 khisalvenus

I had the same issue. The dll file itself is located in the desired folder and the tesseract can find it.

The root of the problem is that tesseract cannot load liblept1753.dll or liblept172.dll. To load the dll tesseract uses kernel32.LoadLibrary which sets the error code 126 (0x7E) (ERROR_MOD_NOT_FOUND The specified module could not be found) and returns IntPtr.Zero and then throws DllNotFoundException.

Verify that you have c:\windows\system32\VCRUNTIME140.DLL and c:\windows\system32\VCRUNTIME140D.DLL. In my case, c:\windows\system32\VCRUNTIME140D.DLL was missing.

buiko20 avatar Aug 12 '19 11:08 buiko20