I want to store some values / variables so that I can change and read them in any class.
What I tryed so far: I created a header file called "settings.h":
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QString>
class Settings {
public:
static QString OutputFormat;
};
#endif // SETTINGS_H
Now I included it in a class with:
#include "settings.h"
But when I try to set this variable:
Settings::OutputFormat = "mp3";
It will not compile with that error:
undefined reference to `Settings::OutputFormat'
What to do? I need something like a settings class. Any class which #include "settings.h" should be able to read the variable values and change them. The values should be global and shared between all classes which include this settings class.