c++ - 使用 C++ 的 Tesseract API 的包装器类

标签 c++ ocr tesseract

我正在尝试使用 C++ 为 TesseractAPI 创建一个包装器类。我从这里找到了一个例子 https://groups.google.com/forum/?fromgroups#!topic/tesseract-ocr/7NIr71BQH8c

当我尝试使用以下命令编译程序时

    g++ -o test TessApi.cpp -l /usr/local/include/tesseract/ -l /usr/include/leptonica/ -L /usr/local/lib/ -l tesseract

不走运,我遇到了以下错误

    TessApi.cpp:1:21: fatal error: baseapi.h: No such file or directory
    compilation terminated.

谁能帮我解决这个问题。 提前致谢。

最佳答案

看来您没有正确指定命令。 -l 指定要链接的库,而 -I 用于指定包含目录。尝试:

g++ -o test TessApi.cpp -I/usr/local/include/tesseract/ -I/usr/include/leptonica/ -L/usr/local/lib/ -ltesseract

假设 Tesseract 实际安装在 /usr/local/ 中。

关于c++ - 使用 C++ 的 Tesseract API 的包装器类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11565138/

相关文章:

c++ - 为什么 opencv 的 Mat::rows 和 Mat::cols 是有符号的而不是无符号的?

python - Tesseract OCR 对 TIFF 文件失败

ocr - Tesseract OCR - 手写字体

unicode - 教 OCR 理解 NSA 和 FISC 修订

linux - 错误 net.sourceforge.tess4j.Tesseract - 无法加载库 'gs' : Native library (linux-x86-64/libgs. 所以)在资源路径中找不到

ios - 如何设置图像大小以提高 OCR 输出?

linker - n 处的成员不是 ELF 对象

C++/C 将第三方库导入到 CMake

c++ - 为什么 clang 不像 #define 那样优化全局常量?

C++ - reference& operator= 在这里做什么