tengo la siguiente clase
#include <windows.h>
#include <iostream>
using namespace std;
struct structMenu
{
int index;
string option;
void (*functionOption)();
structMenu *next;
structMenu *previous;
};
class Menu
{
private:
int indexMenu;
static string value_;
structMenu* Head;
structMenu* Tail;
public:
Menu();
static string getTitle()
{
return value_;
}
static void setTitle(string dataTitle)
{
value_ = dataTitle;
}
void addNewOption(string nameOption, void (*functionOption)());
static void printMenu(Menu thisMenu);
static void spc(int space);
static void jump(int nJump);
};
y obtengo el siguiente error undefined reference to `Menu::value_[abi:cxx11]'|
apareciendo el error en los metodos en los que se hace referencia a este valor
static string getTitle()
{
return value_;
}
static void setTitle(string dataTitle)
{
value_ = dataTitle;
}
Sinceramente no entiendo la naturaleza del error probé realizando el cambio directamente colocando el atributo como publico
public:
static string value_;
y hago referencia a este fuera del programa como
Menu::value_
Pero obtengo el mismo error, agradezco mucho la ayuda, y gracias de antemano.
El error posiblemente este en la forma de declarar value_
...
private:
int indexMenu;
static string value_;
...