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

compile error, ‘class cv::String’ has no member named ‘erase’ #18

Open
laminggg opened this issue Jun 8, 2023 · 4 comments
Open

Comments

@laminggg
Copy link

laminggg commented Jun 8, 2023

i got error ‘class cv::String’ has no member named ‘erase’ when i build this project in codeblocks, how can i address it?

@Qengineering
Copy link
Owner

replace cv::String Str = imagepath; for std::string Str = imagepath;

@laminggg
Copy link
Author

laminggg commented Jun 9, 2023

replace cv::String Str = imagepath; for std::string Str = imagepath;

thanks for your reply, i replace cv::String Str = imagepath; for std::string Str = imagepath in the line 221 and line 248 of main.cpp, it seems to encounter anothor problem in line 248 "std::string &Str = NameFaces[i];" with error "cannot initialize a reference of type "std::__cxx11::string &" with a value of type "cv::String" (non-const qualified)", how can i address it, thank you.

@Qengineering
Copy link
Owner

Dear @laminggg,

cv::String is linked to std::string. They are almost identical. Somehow your OpenCV installation doesn't support all the std::string calls. Best to use not cv::String but std::string. This way you know for sure everything works well.
I have updated the code. Please replace main.cpp with the new version found in this repo.

@laminggg
Copy link
Author

laminggg commented Jun 9, 2023

thank you very much!

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

No branches or pull requests

2 participants