Error when running "make" - scanutils.cpp:38:14: error: typedef redefinition with different types ('long' vs '__darwin_off_t' (aka 'long long'))

237 views
Skip to first unread message

testing1234

unread,
Aug 9, 2014, 4:28:37 PM8/9/14
to tesser...@googlegroups.com
When compiling and running "make" I get the following error:

scanutils.cpp:38:14: error: typedef redefinition with different types ('long' vs '__darwin_off_t'
      (aka 'long long'))
typedef long off_t;
             ^
/usr/include/sys/_types/_off_t.h:30:25: note: previous definition is here
typedef __darwin_off_t          off_t;
                                ^
1 error generated.
make[2]: *** [scanutils.lo] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1


Can anyone help me resolve this?

zdenko podobny

unread,
Aug 10, 2014, 12:23:04 PM8/10/14
to tesser...@googlegroups.com
How are you building tesseract?
According issue tracker[1] there is problem only with OpenCL...


Zdenko


--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/4295af62-3fb5-412f-8d23-878707d33af7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

testing1234

unread,
Aug 10, 2014, 4:32:55 PM8/10/14
to tesser...@googlegroups.com
I was building based on the guide at - [1] https://code.google.com/p/tesseract-ocr/wiki/TesseractSvnInstallation with no OpenCL

Update: as I was able to fix this. I'll detail my whole process in case other OSX users need it... I was able to get it to build on OSX 10.9.4 from SVN and it is working with some warnings (detailed below). The only difference I can think of is I started from scratch by removing everything (ports and formulas) I had installed using either MacPorts or Homebrew, as well as MacPorts and Homebrew themselves. (This was probably a terribly inexperienced mistake having them both installed at the same time.)

Everything built well and without errors this time (Note: I did have warnings, but no errors.).

I have tested Tesseract with TIFF (single and multiple pages) and it is working well. It gives me the following error "Warning in pixReadMemTiff: tiff page 25 not found" in which the page # is always the last page of the file, but it doesn't seem to be a problem.

PNG files do not seem to work (it outputs two identically named files: one that can't be opened and one that only has the first page)

PDF files provide the following error and I can't remember if Leptonica is  supposed to be able to input PDF files or not.
    
Error in fopenReadStream: file not found
Error in pixRead: image file not found: %PDF-1.2
Image file %PDF-1.2 cannot be read!
Error during processing.

I can work on these if I find time, but since TIFF is working they aren't a priority. 

So here is the process that worked for me.

1. Open Terminal
2. Install, update, and verify Homebrew by entering the following one at a time:
brew update
brew doctor
 
3. Make sure brew doctor comes back clean

4. Install the tesseract dependencies listed at [1] above again by entering one at a time (Note: I did not need to install aclocal or autoheader from Homebrew as they aren't formulas.).
   
brew install autoconf
brew install automake
brew install libtool
brew install leptonica --with-libtiff
 
5 .Run the following command (still in Terminal entering one at a time) (again based on the instructions in [1]):

cd tesseract-ocr
./autogen.sh
./configure
make
sudo make install
sudo make install-pangs

6. Assuming you don't get any failures or errors, you can then test using the following commands in Terminal (the italics should be change to your docs specific filenames and the filetype you want to output) (Note: Tesseract defaults its output to .TXT files).

tesseract inputfilename.tiff outputfilename outputfiletype
 
For example: "tesseract mytiff.tiff mysearchablepdf pdf"    will make "mytiff.tiff" a searchable pdf with the name "mysearchablepdf.pdf" and save it into whatever location you run the tesseract command from.

Hopefully this helps someone else and it may be useful to post it under a different (more searchable post title).

Best, 

Cory

testing1234

unread,
Aug 11, 2014, 7:01:41 PM8/11/14
to tesser...@googlegroups.com
Note.. Step 5 above the last command should be

"sudo make install-langs"

Shree Devi Kumar

unread,
Aug 12, 2014, 3:29:11 AM8/12/14
to tesser...@googlegroups.com
Thanks, Cory.

Nick, it maybe helpful to add/update instructions in wiki.

Shree Devi Kumar
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com


Nick White

unread,
Aug 12, 2014, 11:01:58 AM8/12/14
to tesser...@googlegroups.com
On Tue, Aug 12, 2014 at 12:58:23PM +0530, Shree Devi Kumar wrote:
> On Tue, Aug 12, 2014 at 4:31 AM, testing1234
> <cory....@gmail.com> wrote:
>
> Note.. Step 5 above the last command should be
>
> "sudo make install-langs"
>
> Nick, it maybe helpful to add/update instructions in wiki.

Cory just meant in his writeup; the instructions on the wiki are
correct.

Nick
Reply all
Reply to author
Forward
0 new messages