ld: library not found for -llept
thynquest opened this issue · 5 comments
Hello there
I am trying to install gosseract on a macbook m1 but I have the following error with lept
library
ld: library not found for -llept
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and this is the command line I use
LD_LIBRARY_PATH="-L/opt/homebrew/Cellar/leptonica/1.82.0/lib" CGO_CXXFLAGS="-I/opt/homebrew/Cellar/leptonica/1.82.0/include/ -I/opt/homebrew/Cellar/tesseract/5.1.0/include" go get -t github.com/otiai10/gosseract/v2
but despite my effort I do not see what is wrong here
Environment
go version
go version go1.17 darwin/arm64
tesseract --version
tesseract 5.1.0
leptonica-1.82.0
libgif 5.2.1 : libjpeg 9e : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.2 : libopenjp2 2.4.0
Found NEON
Found libarchive 3.6.1 zlib/1.2.11 liblzma/5.2.5 bz2lib/1.0.8 liblz4/1.9.3 libzstd/1.5.2
Found libcurl/7.79.1 SecureTransport (LibreSSL/3.3.6) zlib/1.2.11 nghttp2/1.45.1
thank you for you help.
the same to above
$ uname -a
Darwin xxxx.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 arm64
$ go version
go version go1.17.3 darwin/arm64
$ cat ~/.bash_profile
# lib path
hombrew_path=/usr/local/apps/homebrew/Cellar
export DYLD_LIBRARY_PATH=${hombrew_path}/leptonica/1.82.0/lib/:${hombrew_path}/tesseract/5.1.0/lib/
export C_INCLUDE_PATH=${hombrew_path}/leptonica/1.82.0/include/:${hombrew_path}/tesseract/5.1.0/include/
export CPLUS_INCLUDE_PATH=${hombrew_path}/leptonica/1.82.0/include:${hombrew_path}/tesseract/5.1.0/include/
export LIBRARY_PATH=${hombrew_path}/leptonica/1.82.0/lib/:${hombrew_path}/tesseract/5.1.0/lib/
export LD_LIBRARY_PATH=${hombrew_path}/leptonica/1.82.0/lib/:${hombrew_path}/tesseract/5.1.0/lib/
$ go get -u github.com/otiai10/gosseract/v2
ld: library not found for -llept
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hello there
I am trying to install gosseract on a macbook m1 but I have the following error with
lept
libraryld: library not found for -llept
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and this is the command line I use
LD_LIBRARY_PATH="-L/opt/homebrew/Cellar/leptonica/1.82.0/lib" CGO_CXXFLAGS="-I/opt/homebrew/Cellar/leptonica/1.82.0/include/ -I/opt/homebrew/Cellar/tesseract/5.1.0/include" go get -t github.com/otiai10/gosseract/v2
but despite my effort I do not see what is wrong here
Environment
go version
go version go1.17 darwin/arm64
tesseract --version
tesseract 5.1.0 leptonica-1.82.0 libgif 5.2.1 : libjpeg 9e : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.2 : libopenjp2 2.4.0 Found NEON Found libarchive 3.6.1 zlib/1.2.11 liblzma/5.2.5 bz2lib/1.0.8 liblz4/1.9.3 libzstd/1.5.2 Found libcurl/7.79.1 SecureTransport (LibreSSL/3.3.6) zlib/1.2.11 nghttp2/1.45.1
thank you for you help.
I solved this problem in this way
cd /usr/local/lib
sudo ln -s /opt/homebrew/Cellar/leptonica/1.82.0_1/lib/liblept.a ./
sudo ln -s /opt/homebrew/Cellar/leptonica/1.82.0_1/lib/liblept.5.dylib liblept.dylib
I am also getting this error
fixed it by removing
github.com/otiai10/gosseract
from go.mod, should only have github.com/otiai10/gosseract/v2
I had the same problem
d@ddeMacBook-Pro ~ % go version
go version go1.19.3 darwin/amd64
d@ddeMacBook-Pro ~ % uname -a
Darwin ddeMacBook-Pro.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64 x86_64
/usr/local/go/pkg/tool/darwin_amd64/link: running clang++ failed: exit status 1
ld: library not found for -llept
clang: error: linker command failed with exit code 1 (use -v to see invocation)