Make

Leptonica 編譯錯誤

  • June 11, 2019

嘗試在 Ubuntu 16 上安裝 leptonica v1.78,但由於某種原因無法正常工作。執行./configureand後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

我想我安裝了所有需要的依賴項,我錯過了什麼嗎?

終於知道怎麼弄了,只好用make-for-local才能正常編譯。不確定這是否只是我的情況,因為我沒有看到很多指南使用它。

./configure
./make-for-local
sudo make
./make-for-auto
sudo make install
sudo make -j4 check

引用自:https://unix.stackexchange.com/questions/523940