3
我得到使用CString的錯誤鏈接錯誤是:鏈接出錯的CString
error LNK2001: unresolved external symbol "private: static class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > CConfiguration::_campaignFolderPath" ([email protected]@@[email protected][email protected][email protected][email protected]@@@@@[email protected]@A)
我必須爲它定義一個類:
class CConfiguration
{
private:
static CString _campaignFolderPath;
public:
static void Read();
private:
CConfiguration(void);
~CConfiguration(void);
};
它的讀法的定義是:
void CConfiguration::Read()
{
CConfigFile configReader(_T("Config.ini"));
TCHAR temp[1024];
configReader.GetStringValue(_T("Campaigns"), _T("CampaignsFolderPath"), temp);
_campaignFolderPath = temp;
}
什麼是導致錯誤的線索?我正在使用Visual Studio 2008
錯誤C2039:'CString':不是'CConfiguration'的成員 – akif 2009-10-02 14:56:41
CString CConfiguration :: _ campaignFolderPath;謝謝 – akif 2009-10-02 14:57:19
請編輯您的答案,我相信它是一個錯字 – akif 2009-10-02 14:57:55