learnopencv icon indicating copy to clipboard operation
learnopencv copied to clipboard

I found a compilation error about OCR

Open chinlee1523 opened this issue 2 years ago • 1 comments

@spmallick hi I found this error when COMPILING OCR code on my MAC /opencv/opencv_ex/OCR/ocr_simple.cpp:3:10: fatal error: 'leptonica/allheaders.h' file not found #include <leptonica/allheaders.h> ^~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [CMakeFiles/ocr_simple.dir/ocr_simple.cpp.o] Error 1 make[1]: *** [CMakeFiles/ocr_simple.dir/all] Error 2 make: *** [all] Error 2 So the code here should be:

#ifdef __APPLE__
#include <allheaders.h>
#else
#include <leptonica/allheaders.h>
#endif

and the original code is

#include <leptonica/allheaders.h>

chinlee1523 avatar Mar 23 '22 10:03 chinlee1523

Without trying on my own - as I don't have an APPLE available right now - looks like "APPLE" is not set, is not defined, so going into the "#else" branch.

Can you check whether you have the file "allheaders.h" somewhere in your file-system?

brmarkus avatar Mar 23 '22 10:03 brmarkus