- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试将 Tesseract OCR 库包含到我的 Qt 项目中。我已按照说明进行了所有操作,但它不起作用。
tesseract::TessBaseAPI *myOCR =
new tesseract::TessBaseAPI();
错误 - 对 `tesseract::TessBaseAPI::TessBaseAPI()' 的 undefined reference
我认为是链接问题,但我不确定。查看.pro文件(只需要代码):
unix|win32: LIBS += -L$$PWD/../../Tesseract-OCR/lib/ -llibtesseract302
INCLUDEPATH += $$PWD/../../Tesseract-OCR/include/tesseract
DEPENDPATH += $$PWD/../../Tesseract-OCR/include/tesseract
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../Tesseract-OCR/lib/libtesseract302.lib
unix|win32: LIBS += -L$$PWD/../../Tesseract-OCR/lib/ -lliblept168
INCLUDEPATH += $$PWD/../../Tesseract-OCR/include/leptonica
DEPENDPATH += $$PWD/../../Tesseract-OCR/include/leptonica
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/../../Tesseract-OCR/lib/liblept168.lib
DEFINES += _tagBLOB_DEFINED
DEFINES += USE_STD_NAMESPACE
DEFINES += WINDLLNAME=\\\"lib$$TARGET.dll\\\"
DEFINES += VERSION=\\\"$$VERSION\\\"
DEFINES -= UNICODE
INCLUDEPATH += C:/Tesseract-OCR/tesseract-ocr/api
INCLUDEPATH += C:/Tesseract-OCR/tesseract-ocr/ccmain
INCLUDEPATH += C:/Tesseract-OCR/tesseract-ocr/ccutil
INCLUDEPATH += C:/Tesseract-OCR/tesseract-ocr/ccstruct
INCLUDEPATH += C:/Tesseract-OCR/tesseract-ocr/include
LIBS += C:/Tesseract-OCR/lib/liblept168-static-mtdll.lib
LIBS += C:/Tesseract-OCR/lib/giflib416-static-mtdll.lib
LIBS += C:/Tesseract-OCR/lib/libjpeg8c-static-mtdll.lib
LIBS += C:/Tesseract-OCR/lib/libtiff394-static-mtdll.lib
LIBS += C:/Tesseract-OCR/lib/zlib125-static-mtdll.lib
TessBaseAPI 的每个函数都有相同的错误。
最佳答案
首先:“undefined reference”表示喜欢的人找不到合适的静态库,所以看这个方向。
根据 this , this和 this Tesseract 需要 libtesseract.lib (.a),但也需要 liblept.lib (.a)。
我建议一开始不要对您的 .pro 文件太感兴趣,只尝试构建和运行最低限度的文件(我怀疑它只需要这两个库和可能一些 DLL)。
我还建议在 .pro 文件中指定要链接的库,如下所示:
LIBS += -L" C:/Tesseract-OCR/lib/" -llept
或者像这样更好(如果你的库被复制到你的项目文件夹中)
LIBS += -L" $$_PRO_FILE_PWD_/Tesseract-OCR/lib/" -llept
但不这样
LIBS += C:/Tesseract-OCR/lib/liblept.lib
关于c++ - C++/Qt 中的 undefined reference 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31041323/
我只是有一个更琐碎的问题。 为什么undefined == undefined 返回true,而undefined >= undefined 为false? undefined 等于 undefine
用PHP 7.2编写套接字服务器。根据Firefox 60中的“网络”选项卡,服务器的一些HTTP响应的第一行随机变为undefined undefined undefined。因此,我尝试记录套接字
在 JavaScript 中这是真的: undefined == undefined 但这是错误的: undefined <= undefined 起初我以为<=运算符包含第一个,但我猜它试图将其转换
在回答这个问题 (Difference between [Object, Object] and Array(2)) 时,我在 JavaScript 数组中遇到了一些我以前不知道的东西(具有讽刺意味的
来自https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/of , Note: thi
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
当我添加 到我的 PrimeFaces Mobile 页面,然后我在服务器日志中收到以下警告 WARNING: JSF1064: Unable to find or serve resource, u
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我是一名优秀的程序员,十分优秀!