Код: Выделить всё
#include "exprtk.h"
#include
typedef exprtk::symbol_table symbol_table_t;
typedef exprtk::expression expression_t;
typedef exprtk::parser parser_t;
parser_t parser;
expression_t expression;
symbol_table_t symbol_table;
float a = 5.0f;
std::string equation;
void f()
{
symbol_table.clear();
std::vector varList;
exprtk::collect_variables(equation, varList); // DELETE THIS LINE FOR THE SEGFAULT TO GO AWAY
symbol_table.add_variable("a", a);
parser.compile(equation, expression);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/77855516/segmentation-fault-only-when-including-exprtkcollect-variables-in-the-code-a[/url]