In RHEL 6.7 and RHEL 7.1, unable to "make" cppcheck due to missing member:
...
g++ -Ilib -Iexternals/tinyxml -O2 -include lib/cxx11emu.h -DNDEBUG -Wall -Wno-sign-compare -std=c++0x -c -o lib/checkclass.o lib/checkclass.cpp
lib/checkclass.cpp: In member function ‘void CheckClass::checkConst()’:
lib/checkclass.cpp:1690: error: ‘const struct std::basic_string<char, std::char_traits<char="">, std::allocator<char> >’ has no member named ‘back’
make: *** [lib/checkclass.o] Error 1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I also need to use RHEL6. My workaround for this problem was to replace all calls to std::string::back() with std::string::rbegin(). For example, in cmdlineparser.cpp I replaced all instances of PathName.back() with *PathName.rbegin(). There are six files where this change needs to be made.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I had to do the same with version 1.74...(also: had to #include <limits> in valueflow.cpp). The files I ended up changing were : cli/cmdlineparser.cpp, cli/filelister.cpp, lib/checkclass.cpp, lib/checkunusedvar.cpp, lib/mathlib.cpp (change 'front' to begin() and use the pointer), lib/preprocessor.cpp, lib/token.cpp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In RHEL 6.7 and RHEL 7.1, unable to "make" cppcheck due to missing member:
...
g++ -Ilib -Iexternals/tinyxml -O2 -include lib/cxx11emu.h -DNDEBUG -Wall -Wno-sign-compare -std=c++0x -c -o lib/checkclass.o lib/checkclass.cpp
lib/checkclass.cpp: In member function ‘void CheckClass::checkConst()’:
lib/checkclass.cpp:1690: error: ‘const struct std::basic_string<char, std::char_traits<char="">, std::allocator<char> >’ has no member named ‘back’
make: *** [lib/checkclass.o] Error 1
your g++ is too old. sorry.. I don't know how you fix this best. Is it possible to update the system?
I also need to use RHEL6. My workaround for this problem was to replace all calls to std::string::back() with std::string::rbegin(). For example, in cmdlineparser.cpp I replaced all instances of
PathName.back()
with*PathName.rbegin()
. There are six files where this change needs to be made.Hi, I had to do the same with version 1.74...(also: had to #include <limits> in valueflow.cpp). The files I ended up changing were : cli/cmdlineparser.cpp, cli/filelister.cpp, lib/checkclass.cpp, lib/checkunusedvar.cpp, lib/mathlib.cpp (change 'front' to begin() and use the pointer), lib/preprocessor.cpp, lib/token.cpp