You need several things
- You first need to download both OpenCV repository and OpenCV contrib repository (which contains the actual OCR module).
- Then you need to follow the instructions on the OpenCV contrib page in Github to get it configured correctly.
- During CMAKE be sure that the OCR module is enabled.
- Point your CMAKE to the correct OCR tesseract installation.
- Make sure you link the contrib modules AND that you include the correct namespaces.
Then the software should compile and you program should find the correct functions. Good luck!