J.
Eu percebi que compliquei as coisas, um bocado.
Taí uma versão bem simples, com Makefile padrão, sem gueri-gueri nenhum.
Desculpem aí, qualquer coisa.
J.
Eu percebi que compliquei as coisas, um bocado.
Taí uma versão bem simples, com Makefile padrão, sem gueri-gueri nenhum.
Desculpem aí, qualquer coisa.
A sim agora achei a licença, esta bem mais limpo.
g++ -c -o objs/viewswap.o viewswap.cpp
In file included from viewswap.cpp:20:0:
CProcReader.h:16:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
std::string pid {""};
^
CProcReader.h:17:33: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
std::string procName {""};
^
CProcReader.h:18:31: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
unsigned int rssInK {0};
^
CProcReader.h:19:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
unsigned int swapInK {0};
^
CProcReader.h:23:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
unsigned int totalInK {0};
^
CProcReader.h:24:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
unsigned int maxSwap {0}, maxRes {0};
^
CProcReader.h:24:40: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
unsigned int maxSwap {0}, maxRes {0};
^
CProcReader.h:26:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
std::string lastErr {""};
^
CProcReader.h:31:26: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11
virtual ~CProcReader() override;
^
CProcReader.h:33:31: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11
virtual bool fill_entries() override;
^
CProcReader.h:16:25: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
std::string pid {""};
^
CProcReader.h:16:28: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
std::string pid {""};
^
CProcReader.h:17:30: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
std::string procName {""};
^
CProcReader.h:17:33: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
std::string procName {""};
^
CProcReader.h:18:29: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int rssInK {0};
^
CProcReader.h:18:31: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int rssInK {0};
^
CProcReader.h:19:30: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int swapInK {0};
^
CProcReader.h:19:32: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int swapInK {0};
^
CProcReader.h:23:27: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int totalInK {0};
^
CProcReader.h:23:29: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int totalInK {0};
^
CProcReader.h:24:26: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int maxSwap {0}, maxRes {0};
^
CProcReader.h:24:28: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int maxSwap {0}, maxRes {0};
^
CProcReader.h:24:38: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int maxSwap {0}, maxRes {0};
^
CProcReader.h:24:40: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
unsigned int maxSwap {0}, maxRes {0};
^
CProcReader.h:26:25: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
std::string lastErr {""};
^
CProcReader.h:26:28: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
std::string lastErr {""};
^
viewswap.cpp: In function ‘int main(int, char**)’:
viewswap.cpp:54:15: error: ISO C++ forbids declaration of ‘r’ with no type [-fpermissive]
for(auto &r : reader.entries)
^
viewswap.cpp:54:19: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
for(auto &r : reader.entries)
^
viewswap.cpp:56:48: error: ‘atoi’ is not a member of ‘std’
printf("%8d\t%8d kb\t%8d pages\t%s\n", std::atoi(r.pid.c_str()),
^
viewswap.cpp:56:60: error: request for member ‘pid’ in ‘r’, which is of non-class type ‘int’
printf("%8d\t%8d kb\t%8d pages\t%s\n", std::atoi(r.pid.c_str()),
^
viewswap.cpp:57:18: error: request for member ‘swapInK’ in ‘r’, which is of non-class type ‘int’
r.swapInK, r.swapInK/4, r.procName.c_str());
^
viewswap.cpp:57:29: error: request for member ‘swapInK’ in ‘r’, which is of non-class type ‘int’
r.swapInK, r.swapInK/4, r.procName.c_str());
^
viewswap.cpp:57:42: error: request for member ‘procName’ in ‘r’, which is of non-class type ‘int’
r.swapInK, r.swapInK/4, r.procName.c_str());
^
viewswap.cpp:57:58: error: ‘printf’ was not declared in this scope
r.swapInK, r.swapInK/4, r.procName.c_str());
^
viewswap.cpp:59:79: error: ‘printf’ was not declared in this scope
printf("TOTAL\t : %8d kb\t%8d pages\n", reader.totalInK, reader.totalInK/4);
^
Makefile:4: recipe for target 'viewswap.o' failed
make: *** [viewswap.o] Error 1
Teu compilador também está na versão antiga.
Que triste e vou usar esse sistema ate abril ^^
Uso ele desde o beta eu amo esse 16.04.