Qengineering / Face-Recognition-Jetson-Nano

Recognize 2000+ faces on your Jetson Nano with database auto-fill and anti-spoofing
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
108 stars 31 forks source link

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

Open laminggg opened 1 year ago

laminggg commented 1 year ago

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

Qengineering commented 1 year ago

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

laminggg commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

thank you very much!