1

I'm running 32 bit CentOS 7. I'm trying to install tesseract from source. I have g++ version 4.8.5, and I had errors during compilation (looking like this) and I tried updating g++ from source. After a bit of trouble, I successfully managed to install it, and g++ -v does tell me that it is version 10.0.0.

However, when I run make inside the tesseract folder, the error didn't change.

I found that the new g++ was installed to /usr/local/bin/ whereas the previous version was installed to /usr/bin/, so (I know this is probably really bad, but well...) I made a backup of /usr/bin/g++ and copied the new version (from /usr/local/bin/) in its stead. make started showing a new error:

checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/home/lambda/Téléchargements/tesseract':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
make: *** [config.status] Erreur 77

I wanted to check config.log but it is pretty long. However, I think this part may be interesting:

configure:2592: checking for g++
configure:2608: found /bin/g++
configure:2619: result: g++
configure:2646: checking for C++ compiler version
configure:2655: g++ --version >&5
g++ (GCC) 10.0.0 20191014 (experimental)

I tried compiling a simple hello world program using g++ and it works correctly.

Any help is appreciated! I'm a beginner so I may have forgotten simple things.

Edit:

Here's another part of config.log that may be interesting:

configure:2686: checking whether the C++ compiler works
configure:2708: g++    conftest.cpp  >&5
g++: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
configure:2712: $? = 1
configure:2750: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "tesseract"
| #define PACKAGE_TARNAME "tesseract"
| #define PACKAGE_VERSION "5.0.0-alpha"
| #define PACKAGE_STRING "tesseract 5.0.0-alpha"
| #define PACKAGE_BUGREPORT "https://github.com/tesseract-ocr/tesseract/issues"
| #define PACKAGE_URL "https://github.com/tesseract-ocr/tesseract/"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2755: error: in `/home/lambda/Téléchargements/tesseract':
configure:2757: error: C++ compiler cannot create executables
  • The part of the config.log that you shared is not interesting. The interesting bit is the part where it tries to compile a simple C++ program, but fails. It's not at the very end, but just before the long dump of variables etc. that occupies the last part of the logfile, possibly just after the bit that you quote. – Kusalananda Oct 15 '19 at 10:08
  • 1
    @Kusalananda I edited my post. I think this is the part that you want. – ImranD Oct 15 '19 at 10:17
  • This seems to be an issue with the manual installation of the g++ compiler. Since I'm unfamiliar with this, I can't unfortunately say much more than that. But I noticed that you wrote that you've been copying things around. This might have broken the installation of your compiler(s) (a compiler is much more than just the single g++ executable). – Kusalananda Oct 15 '19 at 10:20
  • @Kusalananda Thanks. I'll try searching about that. – ImranD Oct 15 '19 at 10:26
  • What does g++ -print-prog-name=cc1plus output? – Stephen Kitt Oct 15 '19 at 10:34
0

Alright, I managed to find a way.

Instead of just:

make

I tried using:

make CXX=/usr/local/bin/g++

And it solved my issue...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.