I got this error when I tried to include threading in my project. I came 
here to get solution for the similar problem. I had used "using namespace 
std;"  I commented "using namespace std;" and then also the problem was not 
resolved. While compiling, I had included the two flags -std=c++0x and 
-pthread. I think, the threading related problem may have resolved with 
pthread flag.

Here is a link which says the inclusion of remove_reference in std since 
c++11: http://en.cppreference.com/w/cpp/types/remove_reference 
I thought that the problem is due to the updated version of c++ standard, 
which has predefined remove_reference in std, used during compilation. When 
compiler has definition for remove_reference in std, then the redefinition 
in tesseract_callback.h was causing the error. I commented the redefinition 
in tesseract_callback.h file and made reference to std wherever 
remove_reference was called in the file. The compilation was normal. The 
result was same when executed. The problem was resolved.

I uncommented the line "using namespace std;" and removed the modifications 
made to call the std functions. I could compile and run the program.

On Saturday, 23 August 2014 00:54:51 UTC+5:30, zdenop wrote:
>
> Did you get this error with "using namespace std;"?
>
> Zdenko
>
>
> On Fri, Aug 22, 2014 at 1:53 PM, Deepak Kumar <[email protected] 
> <javascript:>> wrote:
>
>> Tesseract header tesscallback.h file reports error due to redefinition of 
>> remove_reference. This remove_reference is a template and defined in std. 
>>
>> To overcome this problem, I have commented out definition lines in 
>> tesscallback.h file and replaced remove_reference string with 
>> std::remove_reference in other places of the file. There are six 
>> occurrences of remove_reference string after definition.
>>
>> After making these in changes tesscallback.h file, the compilation is 
>> normal.
>>
>> On Friday, 14 March 2014 16:52:41 UTC+5:30, Giseli Ramos wrote:
>>>
>>> I'm trying to compile my project in Qt that uses tesseract and opencv. 
>>> In the .pro file:
>>>
>>> INCLUDEPATH += /usr/local/include/tesseract
>>>
>>> INCLUDEPATH += /usr/local/include/leptonica
>>>
>>> LIBS += -ltesseract -llept
>>>
>>>
>>> The errors (I only past the first lines, because is a big list, all from 
>>> tesscallback.h):
>>>  
>>> In file included from /usr/local/include/tesseract/baseapi.h:31:0,
>>>
>>> from src/utils/ocrReader.cpp:6:
>>>
>>> /usr/local/include/tesseract/tesscallback.h:278:29: error: 
>>> 'remove_reference' is not a template
>>>
>>> /usr/local/include/tesseract/tesscallback.h:278:29: error: redefinition 
>>> of 'struct remove_reference<T>'
>>>
>>> /usr/local/include/tesseract/tesscallback.h:277:29: error: previous 
>>> definition of 'struct remove_reference<T>'
>>>
>>> /usr/local/include/tesseract/tesscallback.h:296:12: error: expected 
>>> nested-name-specifier before 'remove_reference'
>>>
>>> /usr/local/include/tesseract/tesscallback.h:296:12: error: expected ';' 
>>> at end of member declaration
>>>
>>> /usr/local/include/tesseract/tesscallback.h:296:28: error: expected 
>>> unqualified-id before '<' token
>>>
>>> What is strange is that I have compiled with sucess with another simple 
>>> qt project to test tesseract funcionality, with the same config in the .pro 
>>> file. I don't know why this project in particular is having issues. 
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "tesseract-ocr" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/tesseract-ocr.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tesseract-ocr/db209ba4-a04e-40fd-bd40-e3b5402e9664%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tesseract-ocr/db209ba4-a04e-40fd-bd40-e3b5402e9664%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/4e149fea-e121-4c32-a02c-28a23369c611%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to