简体   繁体   English

如何在 MacOS 和 Linux Ubuntu 20.04 上静态编译 tesseract 库?

[英]How to compile tesseract library statically on MacOS & Linux Ubuntu 20.04?

I compiled tesseract library fine, but when I used the same build on other pc it returned me this -我很好地编译了 tesseract 库,但是当我在其他电脑上使用相同的构建时,它返回给我这个 -

dyld: Library not loaded: /usr/local/lib/libtesseract.5.dylib
  Referenced from: /Users/someUser/Downloads/build/.libs/tesseract
  Reason: image not found
Abort trap: 6

After this, I wanted to tell./configure to use this path to these libraries to compile the lib(tesseract) with these libs.在此之后,我想告诉 ./configure 使用这些库的路径来使用这些库编译 lib(tesseract)。 I have tried before./configure things like setting -我之前尝试过。/配置诸如设置之类的东西-

export LDFLAGS="-static -L/usr/local/lib/"

And then it returned this - in this image.然后它返回了这个 -在这张图片中。

I would like to know how I can compile tesseract with this library already included - /usr/local/lib/libtesseract.5.dylib?我想知道如何使用已经包含的这个库编译 tesseract - /usr/local/lib/libtesseract.5.dylib?

Thank you!谢谢!

Okay, several things going on.好的,发生了几件事。 First, it sounds like Tesseract is building a dynamically linked library but not a statically linked version.首先,听起来 Tesseract 正在构建一个动态链接库,而不是静态链接版本。 The -static says (I believe) to prefer the static version, but if there isn't one, it'll still use the dynamic library. -static 表示(我相信)更喜欢 static 版本,但如果没有,它仍然会使用动态库。

So you have two basic choices.所以你有两个基本的选择。 You can figure out how to build a static library instead of a dynamic one.您可以弄清楚如何构建 static 库而不是动态库。 You'll need to read the tesseract documentation.您需要阅读 tesseract 文档。 They might tell you.他们可能会告诉你。 Or else look at the configuration for autoconf to see if that helps.或者查看 autoconf 的配置,看看是否有帮助。

Or you can ship the tesseract libraries as part of your project.或者,您可以将 tesseract 库作为项目的一部分提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM