Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang: error: linker command failed with exit code 1 #237

Open
anurag925 opened this issue Jan 13, 2022 · 1 comment
Open

clang: error: linker command failed with exit code 1 #237

anurag925 opened this issue Jan 13, 2022 · 1 comment

Comments

@anurag925
Copy link

Summary

Previously code was working fine but i installed opencv and that somehow corrupted my go code.
now when i initialise the gosserect client it just throws this error.

# command-line-arguments
/usr/local/go/pkg/tool/darwin_amd64/link: running clang++ failed: exit status 1
Undefined symbols for architecture x86_64:
  "tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool)", referenced from:
      Init(void*, char*, char*) in 000007.o
      _Init in 000007.o
  "tesseract::TessBaseAPI::Recognize(ETEXT_DESC*)", referenced from:
      _GetBoundingBoxes in 000007.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducibility

Inorder to reproduce try to install opencv via brew and then create the client

Environment

uname -a

Darwin Anurags-MacBook-Air.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64

go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/anuragupadhyay/Library/Caches/go-build"
GOENV="/Users/anuragupadhyay/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/anuragupadhyay/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/anuragupadhyay/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/anuragupadhyay/Desktop/Kuvera/tesseract-service/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hy/7r9wprpj5s78xc2df7nny7kw0000gn/T/go-build3362824415=/tmp/go-build -gno-record-gcc-switches -fno-common"

go version

go version go1.17.5 darwin/amd64

tesseract --version

tesseract 5.0.1
leptonica-1.82.0
libgif 5.2.1 : libjpeg 9d : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.1 : libopenjp2 2.4.0
Found AVX2
Found AVX
Found FMA
Found SSE4.1
Found libarchive 3.5.2 zlib/1.2.11 liblzma/5.2.5 bz2lib/1.0.8 liblz4/1.9.3 libzstd/1.5.0
Found libcurl/7.77.0 SecureTransport (LibreSSL/2.8.3) zlib/1.2.11 nghttp2/1.42.0

@otiai10
Copy link
Owner

otiai10 commented Jan 18, 2022

Thank you. This should be fixed in #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants