Home:ALL Converter>Android Studio Can't Find Tesseract Headers in Native C++ Code

Android Studio Can't Find Tesseract Headers in Native C++ Code

Ask Time:2020-08-10T14:04:23         Author:Ege Yıldırım

Json Formatter

I encountered an issue when trying to import "tess-two" module to my Android Studio Project. (I want to use tesseract in my Native C++ code.)

I imported tess-two as module, then copied jni folder under tess-two/src directory. (jni folder includes com_google_tesseract_android folder which has all tesseract header and .cpp files)

However, when i try to include those headers like:

#include  "com_googlecode_tesseract_android/tessbaseapi.cpp"

It autocompletes when i type #include "com_goog....", but gives the error:

fatal error: 'com_googlecode_tesseract_android/tessbaseapi.cpp' file not found


I added tess-two dependency to my app, Same method when i try to include opencv works just fine, I included leptonica too since tesseract is dependent on leptonica, I'm using Ubuntu, NDK Path is selected, I dont use cmake, if there's no easy solution to this issue i will switch to using cmake


Author:Ege Yıldırım,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/63334919/android-studio-cant-find-tesseract-headers-in-native-c-code