agl / jbig2enc

JBIG2 Encoder
Other
251 stars 86 forks source link

error: use of undeclared identifier 'expandBinaryPower2Low' #45

Closed ryandesign closed 10 years ago

ryandesign commented 10 years ago

jbig2enc 0.28 does not build with leptonica 1.70:

jbig2.cc:136:3: error: use of undeclared identifier 'expandBinaryPower2Low'
  expandBinaryPower2Low(pixd->data, pixd->w, pixd->h, pixd->wpl,
  ^
1 error generated.

This was reported to the MacPorts project here: https://trac.macports.org/ticket/43185

DingoDog commented 10 years ago

for your information, I was able to build from sources jbig2enc with leptonica 1.70 without pains on a professional, stable, secure OS (i.e. Linux)

so, you need to try to build jbig2enc with previous leptonica libs releases (you have no benefits from build jbig2enc with newer leptonica), to verify if your compiling environment has problems with newer leptonica, because IT is YOUR COMPILING ENVIRONMENT AT 100% causing problems, since on Linux jbig2enc builds fine even with latest leptonica.

ryandesign commented 10 years ago

I have no doubt that my compiling environment differs from yours, but that does not make mine (or yours) faulty. :)

I have double-checked. jbig2enc 0.28 is able to build with leptonica 1.69, but with leptonica 1.70, the error is:

error: use of undeclared identifier 'expandBinaryPower2Low'

expandBinaryPower2Low is defined in leptonica 1.69 in the file src/binexpandlow.c. In leptonica 1.70, that file has been removed. The leptonica 1.70 version-notes.html state that this file was removed, but they don't say why.

So I do not think it is possible that you can build jbig2enc 0.28 with leptonica 1.70 on any OS and would ask you to re-check that on your system.

zdenop commented 10 years ago

I can confirm that expandBinaryPower2Low is not present in leptonica-1.70 and there we can not build jbig2enc. IMO quick solution is to modified relevant part of jbig2.cc[1] this way: PIX pixd = pixExpandBinary(pixd4, 4); / PIX pixd = pixCreate(piximg->w, piximg->h, 1); pixCopyResolution(pixd, piximg); */ if (verbose) pixInfo(pixd, "mask image: "); / expandBinaryPower2Low(pixd->data, pixd->w, pixd->h, pixd->wpl, pixd4->data, pixd4->w, pixd4->h, pixd4->wpl, 4); */

[1] https://github.com/agl/jbig2enc/blob/master/src/jbig2.cc#L132

zdenop commented 10 years ago

@ryandesign this issue should be fixed in current code. Please check it and if it works for you please close the issue.

ryandesign commented 10 years ago

Works for me! Thanks.

jlgrall commented 10 years ago

@zdenop: thanks.