-
Notifications
You must be signed in to change notification settings - Fork 32
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
Empty new crate build fails on Linux #32
Comments
Hello, thank you for using tesseract and for reporting this issue. These functions look like they all come from the c-api, which is used to auto-generate a Rust wrapper. Can you run # possibly adjust the path to tesseract/capi.h
cat /usr/include/tesseract/capi.h | grep TessBaseAPIGetAltoText and see if the function is declared on your system? Can you tell me the version of the tesseract library you have installed, and any other information that might be unusual about it? |
Hi. A colleague points out that tesseract-rs probably depends on a version 5 library, and I'm probably using a version of the library before version 5.
... and ...
At a glance it looks like the system doesn't have a version 5 library available from the default APT sources. |
Hi. I'm the colleague mentioned above. I would recommend advertising the tesseract version necessary for building all of these related crates via documentation and updating this line to require a minimum version of something like 5.0 so that this confusion is avoided in the future. The new version could look something like the following:
As a bit of a workaround, I have published a working build (using nix flakes) here. |
It looks to me like https://github.com/tesseract-ocr/tesseract/blob/4.1.0/src/api/capi.h#L411 But
Thank you. Will do. Another approach would be for me to put the functions that use these missing functions behind a Rust feature flag. Do you think many other people will be on 4.0.0?
I'm glad to hear you've got a workaround. |
Frankly, I think you have a decision to make. What version do you SUPPORT? If you cannot support tesseract 4.x by testing against tesseract 4.x (which is fine!) , I personally think it may be best to specify the minimum tested version as required in Documenting the required minimum version and enforcing it in This is a long winded way of saying that I have NO IDEA of the prevalence of 4.x versions. |
antimatter15/tesseract-rs#32 (comment) 4.1 was released in July 2019 (>3 years ago). So most people should have it. Except for people using their Linux distro's provided version, it is unlikely anyone is on such an old version. I've not added the restriction to the windows build, as I can't test it so easily and because I don't expect it to be a problem for Windows users. Tested with these commands (more or less) ```bash podman container run --rm -it -v "$(pwd)/Documents:/var/Documents:Z" linuxmintd/mint19.3-amd64 apt-get update && apt-get dist-upgrade --assume-yes apt-get install curl libtesseract-dev tesseract-ocr-eng pkg-config clang --assume-yes curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source "$HOME/.cargo/env" cd /var/Documents/github.com/ccouzens/tesseract-sys cargo clean cargo test ``` It isn't actually true that tesseract-sys requires 4.1.0. But everything that builds on top of it does. It is simplist to put the restriction here.
Hello. I'm a tesseract newbie getting started, but adding tesseract as a dependency looks like it's leading to type discrepancies between tesseract's own dependencies.
Steps to reproduce:
rustup update # (optional)
cargo new try_tesseract && cd try_tesseract
cargo add tesseract
cargo build
The build fails with the errors listed below.
The text was updated successfully, but these errors were encountered: