。H:
class ArithmeticCoding
{
public:
ArithmeticCoding();
static void test(QString text);
static QMap<QChar,int> letters_freq;
}
.cpp:
QMap<QChar, int> letters_freq;
ArithmeticCoding::ArithmeticCoding()
{
}
void ArithmeticCoding::test(QString text)
{
for(int i=0; i<text.length(); i++) letters_freq[text.at(i)]++;
}
我正进入(状态
算术编码.cpp:-1:错误:未定义对“ArithmeticCoding::letters_freq”的引用
为什么?