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

leptonica a hundredth time! #289

Closed
1 task done
yozachar opened this issue Sep 6, 2023 · 7 comments
Closed
1 task done

leptonica a hundredth time! #289

yozachar opened this issue Sep 6, 2023 · 7 comments
Assignees

Comments

@yozachar
Copy link

yozachar commented Sep 6, 2023

Error Summary

$ go run .
# github.com/joe733/railwayjockey
/home/us-er/.local/share/rtx/installs/go/1.21.0/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/ld: cannot find -llept: No such file or directory
/usr/bin/ld: cannot find -llept: No such file or directory
collect2: error: ld returned 1 exit status

Reproducibility

  • Reproducibility Frequency: Every time!
package main

import (
    "fmt"
    "os"

    "github.com/otiai10/gosseract/v2"
)

func errorHandler(errorObject error) {
    if errorObject != nil {
        fmt.Fprintln(os.Stderr, "ERROR:", errorObject.Error())
        os.Exit(1)
    }
}

func eqSolver() {
    println("Creating client")
    client := gosseract.NewClient()
    defer client.Close()
    println("Setting image")
    client.SetImage("./equation.png")
    println("Running OCR")
    text, err := client.Text()
    errorHandler(err)
    fmt.Println(text)
}

func main() {
    eqSolver()
}

Expectation

$ tesseract equation.png text
$ ls -la
Permissions Size User  Group Date Modified Name
.rw-r--r--   411 us-er us-er  6 Sep 12:28  equation.png
.rw-r--r--     9 us-er us-er  6 Sep 14:00  text.txt
$ cat text.txt
94 -50 =

Environment

$ uname -a
Linux tesseract 6.4.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000 x86_64 GNU/Linu
$ go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/us-er/.cache/go-build'
GOENV='/home/us-er/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/us-er/.local/share/rtx/installs/go/1.21.0/packages/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/us-er/.local/share/rtx/installs/go/1.21.0/packages'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/us-er/.local/share/rtx/installs/go/1.21.0/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/us-er/.local/share/rtx/installs/go/1.21.0/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/us-er/eqS/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2451424877=/tmp/go-build -gno-record-gcc-switches'
$ go version
go version go1.21.0 linux/amd64
$ tesseract --version
tesseract 5.3.2
 leptonica-1.83.1
  libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 2.1.5.1) : libpng 1.6.40 : libtiff 4.5.1 : zlib 1.2.13 : libwebp 1.3.1 : libopenjp2 2.5.0
 Found AVX2
 Found AVX
 Found FMA
 Found SSE4.1
 Found OpenMP 201511
 Found libarchive 3.7.1 zlib/1.2.13 liblzma/5.4.3 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.5
 Found libcurl/8.2.1 OpenSSL/3.1.2 zlib/1.3 brotli/1.0.9 zstd/1.5.5 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh2/1.11.0 nghttp2/1.55.1

Related #234 #248 #272 #274

@otiai10
Copy link
Owner

otiai10 commented Sep 6, 2023

I guess this commit solves your issue, though I didn't tag and release it yet
6e8ea62

@otiai10
Copy link
Owner

otiai10 commented Sep 6, 2023

Can you please check on your environment?
I'm sure all the CI tests passed.

@otiai10 otiai10 self-assigned this Sep 6, 2023
@otiai10
Copy link
Owner

otiai10 commented Sep 6, 2023

I just tagged v2.4.1. Please check it out

@gasovn
Copy link

gasovn commented Sep 6, 2023

Hi!

Same error for me with go1.21.0.

Tag v2.4.1 fixed problem for me, thanks!

@otiai10 otiai10 closed this as completed Sep 6, 2023
@yozachar
Copy link
Author

yozachar commented Sep 7, 2023

Tag v2.4.1 works, thank you!

@filiprejmus
Copy link

How can I install with the 2.4.1 tag? Latest is 2.2.1 I think?

@otiai10
Copy link
Owner

otiai10 commented Mar 20, 2024

https://pkg.go.dev/github.com/otiai10/gosseract/v2

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

4 participants