LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2017, 05:42 AM   #1
shahrukhsatti21
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Rep: Reputation: Disabled
libstdc++ error during tesseract compilation


Hi,
I am compiling tesseract 4.00 at oracle linux 6.8 following these steps.
Code:
git clone https://github.com/tesseract-ocr/tesseract.git

cd tesseract

./autogen.sh

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib

LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make

sudo make install

sudo ldconfig
The pre-built version of gcc (gcc-4.4) does not support c++11 (which is essential for tesseract compilation) so I had to compile gcc-6.3. While compiling tesseract, ./autogen.sh and ./configure went good without errors but "make" step shows following error:
Code:
/usr/local/lib/../lib/libstdc++.so: could not read symbols: File in wrong format
collect2: error: ld returned 1 exit status
Kindly help me with this.
Thanks.
 
Old 06-22-2017, 06:50 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,316

Rep: Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578
Welcome to LQ.
Quote:
The pre-built version of gcc (gcc-4.4)
That's the CentOS 6.9 / Oracle 6.x system compiler, gcc-4.4.7 .

Please use gcc-5.3 for CentOS 6.9 / RHEL 6.9 : Comes with internal {libstdc++ libgomp libgcc_s}
→ gcc53-c++-5.3.0-1.el6.x86_64.rpm
https://drive.google.com/file/d/0B7S...ew?usp=sharing
# cd Downloads/ && yum install ./gcc53-c++-5.3.0-1.el6.x86_64.rpm
exit
cd tesseract/
make distclean
export CC=gcc53 CXX=g++53 && ./configure --options

-

Last edited by knudfl; 06-22-2017 at 06:58 AM.
 
Old 06-22-2017, 07:12 AM   #3
shahrukhsatti21
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

That's the CentOS 6.9 / Oracle 6.x system compiler, gcc-4.4.7 .

Please use gcc-5.3 for CentOS 6.9 / RHEL 6.9 : Comes with internal {libstdc++ libgomp libgcc_s}
→ gcc53-c++-5.3.0-1.el6.x86_64.rpm
https://drive.google.com/file/d/0B7S...ew?usp=sharing
# cd Downloads/ && yum install ./gcc53-c++-5.3.0-1.el6.x86_64.rpm
exit
cd tesseract/
make distclean
export CC=gcc53 CXX=g++53 && ./configure --options

-
Thanks knudfl,
Upon drilling deeper, I've found out that I'll have to change the default libstdc++. When I run
Code:
/sbin/ldconfig -p | grep stdc++
Result is
Code:
/usr/lib64/libstdc++.so.5
. Which shows version 5 is currently default libstdc++. I can see version 6 files too in /usr/local/lib64 which, I believe, came internal with the compilation of gcc 6.3. Would you help me change this default lib? Your suggestion is good too but I want to make sure if this works. It might prevent gcc-5.3 compilation. Thanks again.
 
Old 06-22-2017, 07:27 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,316

Rep: Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578
Re #3.
Quote:
/usr/lib64/libstdc++.so.5
Can't be right that you have no libstdc++.so.6 ? Then no firefox etc. ?
→ # yum install gcc-c++
It's not about "change": You can have both (all) versions of libstdc++.


About gcc53-c++-5.3.0-1.el6.x86_64 : Time stamp = Jul 22 2016.
Is well tested as "CentOS 6 / RHEL 6 extra compiler".
Anyone on the internet can download it.
And does OK with tesseract :
Code:
libtool: link: g++53 -g -O2 -std=c++11 -o .libs/tesseract tesseract-tesseractmain.o -fopenmp  ./.libs/libtesseract.so /usr/local/gcc53/lib/../lib64/libstdc++.so /usr/lib64/liblept.so -lm -lz -lpng -ljpeg -lgif -ltiff -lrt -lpthread -fopenmp -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/gcc53/lib/../lib64
make[2]: Leaving directory '/home/knudfl/tmp/tesseract/api'
Making all in .
make[2]: Entering directory '/home/knudfl/tmp/tesseract'
make[2]: Leaving directory '/home/knudfl/tmp/tesseract'
Making all in tessdata
make[2]: Entering directory '/home/knudfl/tmp/tesseract/tessdata'
Making all in configs
make[3]: Entering directory '/home/knudfl/tmp/tesseract/tessdata/configs'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/knudfl/tmp/tesseract/tessdata/configs'
Making all in tessconfigs
make[3]: Entering directory '/home/knudfl/tmp/tesseract/tessdata/tessconfigs'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/knudfl/tmp/tesseract/tessdata/tessconfigs'
make[3]: Entering directory '/home/knudfl/tmp/tesseract/tessdata'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/knudfl/tmp/tesseract/tessdata'
make[2]: Leaving directory '/home/knudfl/tmp/tesseract/tessdata'
Making all in doc
make[2]: Entering directory '/home/knudfl/tmp/tesseract/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/knudfl/tmp/tesseract/doc'
make[1]: Leaving directory '/home/knudfl/tmp/tesseract'
( That's the last lines in the 'make' sequence.)

-

Last edited by knudfl; 06-22-2017 at 07:37 AM.
 
Old 07-22-2017, 03:29 PM   #5
shahrukhsatti21
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi, I'm sorry I was away for exams and other commitments.
"make distclean" is unsuccessful stating "leptonica 1.74 or higher version is required". Did you have libtiff5, libpng12 and libjpeg8 already which are mentioned as prereqs in tesseract compilation doc? I can't find them at yum and epel repos and only older versions are available. Leptonica compilation is done without errors but I guess unavailability of prereq libs could be the reason for unsuccessful distclean or may be not. Just in case you needed to know I'm trying to OCR vehicle license plates as part of my school project. Would distribute output in HDFS files.
Thanks!
 
Old 07-24-2017, 03:40 PM   #6
shahrukhsatti21
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #3.


( That's the last lines in the 'make' sequence.)

-
Just in case you didn't see the reply #5.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] tesseract stopped. error withut explanation. littlejoe5 Linux - Software 3 11-15-2013 01:26 AM
tesseract stopped. error without explanation. littlejoe5 Linux - Software 1 11-14-2013 11:31 PM
[SOLVED] where to get compat-libstdc++-33 and libstdc++.so.5 files for Symantec Backup Agent ? albertwt Linux - Newbie 4 09-09-2010 10:02 AM
Compiling tesseract-2.03: error: ‘INT32’ was not declared in this scope J_Szucs Linux - Software 10 03-05-2009 03:35 PM
Need older libraries: libstdc++-3.2.4, libstdc++-libc6.-1.so.2, & compat-2004.7.1 al_moline SUSE / openSUSE 2 10-19-2007 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration