Skip to content

Added USING_STD_NAMESPACE macro to text module #1337

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

Merged
merged 2 commits into from
Aug 24, 2017
Merged

Conversation

ahmedyarub
Copy link

@ahmedyarub ahmedyarub commented Aug 20, 2017

resolves #1324

Added USING_STD_NAMESPACE macro since "-DUSING_STD_NAMESPACE is now needed for all of the tesseract library, not just for training."

@@ -48,6 +48,9 @@
#include "text_config.hpp"

#ifdef HAVE_TESSERACT
#if !defined(USE_STD_NAMESPACE)
#define USE_STD_NAMESPACE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no mentions of this macro in the Opencv code? Why do you need this?

Copy link
Contributor

@LaurentBerger LaurentBerger Aug 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think problem is explained here
Problem is : at line using tesseract 4.00.0alpha

I don't understand problem at line there is a std:: before vector but no std before string.

Using std::string does not comply with Google's coding conventions.

@stweil

I don't think macro is good idea but problem must be solved.

@fifothekid if you need tesseract now insert std before string and problem is solved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LaurentBerger exactly

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LaurentBerger, using that macro is the new correct way to solve the problem with string. I'm afraid that Google's coding conventions are something which we cannot change. The usage of std:: is inconsistent, yes.

In addition to the macro, I'd also add a comment which explains why the macro is needed. Maybe some day it won't be needed any more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fifothekid argee, comment is needed here and eliminate merge commit please.

Copy link
Contributor

@LaurentBerger LaurentBerger Aug 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Macro is here and only used by tesseract( on my knowledge). May be insert in precomp.hpp :

#include <string>
using std::string;

would be readable

@stweil I have got some difficulties to find rule in google coding convetion. Is it this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LaurentBerger Thanks man, your code worked like a charm.

@ahmedyarub
Copy link
Author

@LaurentBerger they simply don't accept adding std:: before string and what you said makes sense
so how can this be resolved?

@alalek
Copy link
Member

alalek commented Aug 24, 2017

👍

@amitdo
Copy link

amitdo commented Mar 14, 2018

Tesseract is now at beta 1 stage.

This version uses std:string everywhere. USE_STD_NAMESPACE is not needed anymore.

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

Successfully merging this pull request may close these issues.

Error while "Built target opencv_saliency_pch_dephelp"
7 participants