Can't build with Tesseract 3.04

Issue #3 new
George V. Reilly created an issue

EDIT The real problem is building with Tesseract 3.04, not with using CLang 7.0. When I revert to (a hand-built) Tesseract 3.03, then python-tesseract builds and installs.


I get compiler errors when I try to run python setup.py install.

$ python setup.py install
..........
Current Version : 0.8
os=darwin
~~~cv_pc~~~
{'libraries': ['opencv_superres', 'opencv_nonfree', 'opencv_videostab', 'opencv_ml', 'opencv_ocl', 'opencv_contrib', 'opencv_flann', 'opencv_calib3d', 'opencv_imgproc', 'opencv_core', 'opencv_legacy', 'opencv_stitching', 'opencv_features2d', 'opencv_photo', 'opencv_ts', 'opencv_video', 'opencv_objdetect', 'opencv_highgui', 'opencv_gpu'], 'library_dirs': ['/usr/local/Cellar/opencv/2.4.12/lib'], 'include_dirs': ['/usr/local/Cellar/opencv/2.4.12/include/opencv', '/usr/local/Cellar/opencv/2.4.12/include']}
['libraries', 'library_dirs', 'include_dirs']
===========['stdc++', 'tesseract', 'lept', 'opencv_superres', 'opencv_nonfree', 'opencv_videostab', 'opencv_ml', 'opencv_ocl', 'opencv_contrib', 'opencv_flann', 'opencv_calib3d', 'opencv_imgproc', 'opencv_core', 'opencv_legacy', 'opencv_stitching', 'opencv_features2d', 'opencv_photo', 'opencv_ts', 'opencv_video', 'opencv_objdetect', 'opencv_highgui', 'opencv_gpu']===========
['.', '/usr/local/include/tesseract', '/usr/local/include/leptonica']
[]
running install
running bdist_egg
running egg_info
writing python_tesseract.egg-info/PKG-INFO
writing top-level names to python_tesseract.egg-info/top_level.txt
writing dependency_links to python_tesseract.egg-info/dependency_links.txt
file tesseract.py (for module tesseract) not found
reading manifest file 'python_tesseract.egg-info/SOURCES.txt'
writing manifest file 'python_tesseract.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-x86_64/egg
running install_lib
running build_py
file tesseract.py (for module tesseract) not found
file tesseract.py (for module tesseract) not found
running build_ext
building '_tesseract' extension
swigging tesseract.i to tesseract_wrap.cpp
swig -python -c++ -I/usr/local/include/tesseract -I/usr/local/include/leptonica -o tesseract_wrap.cpp tesseract.i
/usr/local/include/tesseract/publictypes.h:82: Warning 462: Unable to set dimensionless array variable
creating build
creating build/temp.macosx-10.10-x86_64-2.7
clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I. -I/usr/local/include/tesseract -I/usr/local/include/leptonica -I/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c tesseract_wrap.cpp -o build/temp.macosx-10.10-x86_64-2.7/tesseract_wrap.o -Wall -O0 -funroll-loops -g
tesseract_wrap.cpp:5828:11: error: no matching member function for call to 'SetImage'
  (arg1)->SetImage((Pix const *)arg2);
  ~~~~~~~~^~~~~~~~
/usr/local/include/tesseract/baseapi.h:354:8: note: candidate function not viable: 1st argument
      ('const Pix *') would lose const qualifier
  void SetImage(Pix* pix);
       ^
/usr/local/include/tesseract/baseapi.h:341:8: note: candidate function not viable: requires 5
      arguments, but 1 was provided
  void SetImage(const unsigned char* imagedata, int width, int height,
       ^
tesseract_wrap.cpp:6251:82: error: cannot initialize a parameter of type
      'tesseract::TessResultRenderer *' with an lvalue of type 'STRING *'
  result = (bool)(arg1)->ProcessPages((char const *)arg2,(char const *)arg3,arg4,arg5);
                                                                                 ^~~~
/usr/local/include/tesseract/baseapi.h:542:63: note: passing argument to parameter 'renderer' here
                    int timeout_millisec, TessResultRenderer* renderer);
                                                              ^
tesseract_wrap.cpp:6333:91: error: cannot initialize a parameter of type
      'tesseract::TessResultRenderer *' with an lvalue of type 'STRING *'
  result = (bool)(arg1)->ProcessPage(arg2,arg3,(char const *)arg4,(char const *)arg5,arg6,arg7);
                                                                                          ^~~~
/usr/local/include/tesseract/baseapi.h:558:40: note: passing argument to parameter 'renderer' here
                   TessResultRenderer* renderer);
                                       ^
3 errors generated.
error: command 'clang' failed with exit status 1

$ clang --version
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

Comments (1)

  1. Log in to comment