我想在Visual C++中編譯,並將這個配置文件加載器/解析器添加到我的項目中。對於類CProfileData定義了一些曾經函數接收兩個錯誤中的至少一個:類定義文件中的Win32程序編譯器錯誤
missing type specifier - int assumed.
syntax error : missing ',' before '&'
當顯然這應該只是一個參考的字符串
#ifdef UVSS_EXPORTS
#define UVSS_API __declspec(dllexport)
#else
#define UVSS_API __declspec(dllimport)
#endif
class CProfileData
{
public:
UVSS_API CProfileData(){};
UVSS_API CProfileData(const string& profileFile);
UVSS_API ~CProfileData(void);
UVSS_API bool GetVariable(const string& sectionName, const string& variableName, string& valueRet);
UVSS_API bool GetSection(const string& sectionName, SECTION_MAP **pMapRet);
UVSS_API bool GetVariableW(const string& sectionName, const string& variableName, wstring& valueRet);
UVSS_API bool GetVariableInt(const string& sectionName, const string& variableName, int *pIntRet);
private:
void ToLower(string& str);
void TrimWhitespace(string& str);
bool IsComment(const string& str);
bool IsSection(const string& str, string& secName);
bool IsVariable(const string& str, string& name, string& value);
PROFILE_MAP m_mapProfile;
};
你試過' #include'?然後你需要將thos字符串變成'std :: string'。 –
2011-05-26 13:51:10