当我尝试构建我的iOS应用程序时,出现以下链接器错误。将C++标准库设置为“libstdc ++”可能会解决此问题,但我不确定如何在QT creator中执行此操作。
Undefined symbols for architecture armv7:
"tesseract::TessBaseAPI::End()", referenced from:
Ocr::~Ocr() in ocr.o
"tesseract::TessBaseAPI::SetImage(Pix const*)", referenced from:
Ocr::recognize(char const*) in ocr.o
"tesseract::TessBaseAPI::GetUTF8Text()", referenced from:
Ocr::recognize(char const*) in ocr.o
"_pixRead", referenced from:
Ocr::recognize(char const*) in ocr.o
"_pixDestroy", referenced from:
Ocr::recognize(char const*) in ocr.o
"tesseract::TessBaseAPI::TessBaseAPI()", referenced from:
Ocr::Ocr(char const*) in ocr.o
"tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool)", referenced from:
Ocr::Ocr(char const*) in ocr.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
.pro 文件的相关部分
QMAKE_CXXFLAGS = -stdlib=libstdc++
macx: LIBS += -L$$PWD/TesseractOCR/lib/ -llept
INCLUDEPATH += $$PWD/TesseractOCR/include
DEPENDPATH += $$PWD/TesseractOCR/include
macx: PRE_TARGETDEPS += $$PWD/TesseractOCR/lib/liblept.a
macx: LIBS += -L$$PWD/TesseractOCR/lib/ -ltesseract_all
INCLUDEPATH += $$PWD/TesseractOCR/include
DEPENDPATH += $$PWD/TesseractOCR/include
macx: PRE_TARGETDEPS += $$PWD/TesseractOCR/lib/libtesseract_all.a