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

Compilation error #200

Open
asimakos opened this issue Aug 9, 2020 · 18 comments
Open

Compilation error #200

asimakos opened this issue Aug 9, 2020 · 18 comments

Comments

@asimakos
Copy link

asimakos commented Aug 9, 2020

I have followed all your installation instructions to use your great golang package for tesseract-ocr 4.0 (dev) (Windows environment) for golang 1.14 in order to run the example app in your github repo, but unfortunately i get the following error:

# github.com/otiai10/gosseract
tessbridge.cpp:5:34: fatal error: leptonica/allheaders.h: No such file or directory
 #include <leptonica/allheaders.h>
                                  ^
compilation terminated.

For your better assistance, i attach you the following information regarding my golang environment:

info

Any hint would be convenient to me!

Regards

@otiai10
Copy link
Owner

otiai10 commented Aug 10, 2020

Because you didn't install leptonica

@asimakos
Copy link
Author

I just found the following list of leptonica developer and build packages for Windows here.
I would like your assistance, if possible regarding leptonica build package that contains only two folders (include and lib) of where exactly i place them.

That would help me a lot!

Regards

@otiai10
Copy link
Owner

otiai10 commented Aug 10, 2020

@asimakos
Copy link
Author

I had read the following interesting article to install and use tesseract-ocr-setup-4.00.00dev.exe, but now i just found the following list that might help.

I am afraid that it is a whole process to compile tesseract in Windows that may not succeed.

Regards

@otiai10
Copy link
Owner

otiai10 commented Aug 10, 2020

Did you check this? #132

could be helpful, then

@asimakos
Copy link
Author

Sorry for the late response!

Unfortunately the above link did not help me and I made a little research and i found that it's possible to install leptonica and tesseract via msys2 packages for Windows 32-bit and 64-bit for tesseract and leptonica.

I managed to install them via this useful package manager, but i get the same error when i run go get command.

# github.com/otiai10/gosseract
tessbridge.cpp:5:34: fatal error: leptonica/allheaders.h: No such file or directory
 #include <leptonica/allheaders.h>
                                  ^
compilation terminated.

I think it would be better to try yourself via msys2 and tell me where i make the error.

That would help me a lot!

Regards

@otiai10
Copy link
Owner

otiai10 commented Aug 14, 2020

The only thing I can say is either your INCLUDE_PATH is wrong or you didn't install header files for leptonica which can be install via such as leptonica-dev.

@asimakos
Copy link
Author

asimakos commented Aug 18, 2020

Sorry again for the late response!

For your better assistance, i attach you several images where i have installed leptonica and tesseract via msys2 package manager.

Additionally i define the following environment variables:
CGO_CFLAGS=-I C:\msys32\mingw32\include\
CGO_LDFLAGS=-L C:\msys32\mingw32\lib\

but i receive the same error!

Regards

pic1

pic2

pic3

pic4

pic5

@minskiter
Copy link

Same problem,too. I dont want to compile full tesseract-ocr on win10.Is there any solution?

@pdiwadkar
Copy link

pdiwadkar commented Feb 14, 2021

Same problem. Struggling to install/run Gosseract for last 3 days.
Tried with tesseract 5.0 Alpha and Tesseract 4.0. I copied all header files from Leptonica/Tesseract inside gosseract/leptonica and gosseract/tesseract folders . It got success but then running the program throws the error-
got this error : exit status 3221226356
Environment- Windows 10 / golang 1.15/

@karliky
Copy link

karliky commented Mar 27, 2021

I'm facing the same problem "#include <leptonica/allheaders.h>". Would be great to have building instructions for Windows, I've tried compiling liptonica etc but always face the same issue

@karliky
Copy link

karliky commented Apr 5, 2021

@otiai10 Can you help us? 😄

@otiai10
Copy link
Owner

otiai10 commented Apr 5, 2021

Working on it but not able to take so much time currently 🙇

@Skwol
Copy link

Skwol commented Apr 12, 2021

I have the same error on mac (big sur 11.2.3). I'm not sure what caused this but for some reason gosseract is looking for includes in some unexpected place, I've forked code and changed cpp bridge from:
#include <leptonica/allheaders.h> #include <tesseract/baseapi.h>
to:
#include "/usr/local/include/leptonica/allheaders.h" #include "/usr/local/include/tesseract/baseapi.h"

What is causing this? Am I missing some env variable? Everything installed via brew and tesseract works fine.

@karliky
Copy link

karliky commented Apr 12, 2021

@Skwol Did setting the absolute path worked for you?

@Skwol
Copy link

Skwol commented Apr 12, 2021

@Skwol Did setting the absolute path worked for you?

yes, it did help

@andituzi
Copy link

我也遇到了同样的问题,并且通过这种方式安装了leptonica
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh # "./bootstrap-vcpkg.bat" for powershell
./vcpkg integrate install
./vcpkg install leptonica

@echotrue
Copy link

@asimakos Your leptonica and tesseract libraries files in mingw32/include , try mingw32.exe instead of msys2.exe .

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

No branches or pull requests

8 participants