nicht aufgelöstes externes Symbol
-
morge
class Account { public: void applyint() { amount += amount * interestRate; } static double rate() { return interestRate; } static void rate(double); private: std::string owner; double amount; static double interestRate; /* HIER DER FELHER */ static double initRate(); };es gibt folgende fehler=
1>main.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""private: static double Account::interestRate" (?interestRate@Account@@0NA)". 1>main.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.wieso?
MFG
-
Statische Vars müssen ausshalb der Klasse nochmal aufgeführt (instanziert?) werden:
im .cpp file:
double Account::interestRate;rya.