尝试在 Ubuntu 16 上安装 leptonica v1.78,但由于某种原因无法正常工作。运行./configure
和后make
,我不断收到此错误:
make[2]: Entering directory '/home/user/Documents/leptonica/leptonica-1.78.0/prog'
CC convertfilestopdf.o
CCLD convertfilestopdf
../src/.libs/liblept.so: undefined reference to `lzham_z_version'
../src/.libs/liblept.so: undefined reference to `lzham_z_deflateInit'
../src/.libs/liblept.so: undefined reference to `lzham_z_inflate'
../src/.libs/liblept.so: undefined reference to `lzham_z_deflate'
../src/.libs/liblept.so: undefined reference to `lzham_z_deflateEnd'
../src/.libs/liblept.so: undefined reference to `lzham_z_inflateInit'
../src/.libs/liblept.so: undefined reference to `lzham_z_inflateEnd'
collect2: error: ld returned 1 exit status
Makefile:2603: recipe for target 'convertfilestopdf' failed
make[2]: *** [convertfilestopdf] Error 1
make[2]: Leaving directory '/home/user/Documents/leptonica/leptonica-1.78.0/prog'
Makefile:476: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/user/Documents/leptonica/leptonica-1.78.0'
Makefile:385: recipe for target 'all' failed
make: *** [all] Error 2
我想我安装了所需的所有依赖项,我是否缺少某些东西?
答案1
终于找到办法了,只好使用make-for-local
才能正常编译。不确定这是否只是我的情况,因为我没有看到很多指南使用它。
./configure
./make-for-local
sudo make
./make-for-auto
sudo make install
sudo make -j4 check