我有这个班级
ArabicHarakat.h
#pragma once
#include <string>
using namespace std;
namespace sarf{
class ArabicHarakat
{
public:
static const wstring FATHA ;
static const wstring DAMMA ;
static const wstring KASRA ;
static const wstring SKOON ;
static const wstring SHADDA ;
};
}
ArabicHarakat.cpp
#include "ArabicHarakat.h"
namespace sarf{
const wstring ArabicHarakat::FATHA = L"ظژ";
const wstring ArabicHarakat::DAMMA = L"ظڈ";
const wstring ArabicHarakat::KASRA = L"ظگ";
const wstring ArabicHarakat::SKOON = L"ظ’";
const wstring ArabicHarakat::SHADDA = L"ظ‘";
}
我想使用这些常量来初始化像这样的数组
wstring ImperativeConjugationDataContainer::emphasizedLastDimList[13] = {L"", L"", ArabicHarakat::FATHA
, ArabicHarakat::KASRA, ArabicHarakat::FATHA, ArabicHarakat::DAMMA, ArabicHarakat::SKOON
, L"", L"", L"", L"", L"", L""};
和这样的动词结合
inline wstring AugmentedActivePastVerb::ConjugateInFormula6()
{
return L"أ‡"+root->getC1()+ArabicHarakat::SKOON+root->getC2()+ArabicHarakat::FATHA+root->getC3()+ArabicHarakat::FATHA+root->getC3()+lastDpa+connectedPronoun;
}
但是当我编译这段代码时,它给了我这个错误
对`sarf :: ArabicHarakat :: SKOON
的未定义引用对`sarf :: ArabicHarakat :: KASRA
的未定义引用对`sarf :: ArabicHarakat :: FATHA
的未定义引用对`sarf :: ArabicHarakat :: DAMMA
的未定义引用
等等
我在所有使用它的文件中包含ArabicHarakat.h,但它不会在调试文件夹中生成ArabicHarakat.o文件
注意:我在ubuntu 13.10上使用代码块