Skip to content

Commit

Permalink
Fix linker error for baseapi_test when building without legacy engine
Browse files Browse the repository at this point in the history
Linker error reported in issue tesseract-ocr#2439:

    unittest/baseapi_test.cc:190:
      undefined reference to
      `tesseract::TessBaseAPI::AdaptToWordStr(tesseract::PageSegMode, char const*)'

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed May 16, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7e9d2f4 commit 780986e
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions unittest/Makefile.am
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@ AM_CPPFLAGS += -DTESSDATA_BEST_DIR="\"$(TESSDATA_BEST_DIR)\""
AM_CPPFLAGS += -DTESTING_DIR="\"$(TESTING_DIR)\""
AM_CPPFLAGS += -DTESTDATA_DIR="\"$(TESTDATA_DIR)\""
AM_CPPFLAGS += -DPANGO_ENABLE_ENGINE
if DISABLED_LEGACY_ENGINE
AM_CPPFLAGS += -DDISABLED_LEGACY_ENGINE
endif
AM_CPPFLAGS += -I$(top_builddir)/src/api
AM_CPPFLAGS += -I$(top_srcdir)/src/api
AM_CPPFLAGS += -I$(top_srcdir)/src/arch
5 changes: 5 additions & 0 deletions unittest/baseapi_test.cc
Original file line number Diff line number Diff line change
@@ -166,6 +166,10 @@ TEST_F(TesseractTest, RickSnyderNotFuckSnyder) {

// Tests that Tesseract gets exactly the right answer on some page numbers.
TEST_F(TesseractTest, AdaptToWordStrTest) {
#ifdef DISABLED_LEGACY_ENGINE
// Skip test because TessBaseAPI::AdaptToWordStr is missing.
GTEST_SKIP();
#else
static const char* kTrainingPages[] = {
"136.tif", "256.tif", "410.tif", "432.tif", "540.tif",
"692.tif", "779.tif", "793.tif", "808.tif", "815.tif",
@@ -204,6 +208,7 @@ TEST_F(TesseractTest, AdaptToWordStrTest) {
EXPECT_STREQ(kTestText[i], ocr_text.c_str());
pixDestroy(&src_pix);
}
#endif
}

// Tests that LSTM gets exactly the right answer on phototest.

0 comments on commit 780986e

Please sign in to comment.