Как решить проблему утечки памяти для опций программы повышения

Я использую следующие опции программы повышения

#include <boost/program_options.hpp>
using namespace boost::program_options;

#include <iostream>
using namespace std;

/* Auxiliary functions for checking input for validity. */int main(int argc, char* argv[])
{
try {
string ofile;
string macrofile, libmakfile;
bool t_given = false;
bool b_given = false;
string mainpackage;
string depends = "deps_file";
string sources = "src_file";
string root = ".";

options_description desc("Allowed options");
desc.add_options()
// First parameter describes option name/short name
// The second is parameter to option
// The third is description
("help,h", "print usage message")
("output,o", value(&ofile), "pathname for output")
("macrofile,m", value(&macrofile), "full pathname of macro.h")
;

}
catch(exception& e) {
cerr << e.what() << "\n";
}

}

I am using   gcc-5.4.0-static and I am getting memory leak error

Утечка памяти. Динамическая память хранится в ‘po :: value> ( &i _) значение «распределено через функцию», std :: allocator>, std :: allocator, std :: allocator>>>> ‘в строке 1, теряется в конце строки в строке addOptions

I am using   gcc-5.4.0-static and I am getting memory leak error

Утечка памяти. Динамическая память хранится в ‘po :: value> ( &i _ofile) значение «распределено через функцию», std :: allocator>, std :: allocator, std :: allocator>>>> в строке 20, теряется в конце строки (22)

-4

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]