Menu

Cannot build cppcheck 1.70 in RHEL Linux

Scott
2015-09-17
2016-06-15
  • Scott

    Scott - 2015-09-17

    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

     
  • Daniel Marjamäki

    your g++ is too old. sorry.. I don't know how you fix this best. Is it possible to update the system?

     
  • Steven Cook

    Steven Cook - 2015-10-28

    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.

     
  • penguish

    penguish - 2016-06-15

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.