Mam mały problem. Otoz zadeklarowałem klase:
#ifndef EVENTS_H_INCLUDED
#define EVENTS_H_INCLUDED
#include<iostream>
class Event
{
int day;
std::string name;
static bool status;
public:
Event();
Event(std::string n, int d, bool s = false);
~Event();
....
};
a w pliku cpp zdefiniowalem konstruktor:
#include <iostream>
#include<fstream>
#include "events.h"
using namespace std;
Event::Event()
{
day = 0;
name = "brak";
status = false;
}
przy statusie wyskakuje błąd undefined reference to Event::status. Przy kolejnym konstruktorze i metodach to samo. Czy to powód statycznego przydziału pamieci ?