在my.h文件我有這樣的聲明:解析的外部符號「公共靜態結構」
/**
* XMLReader Class
*
* Defines the required function to parse and get data from XML File
**/
class XMLReader {
public:
XMLReader();
~XMLReader();
static BOOL XmlFinder(WCHAR* argv, const WCHAR* log,const WCHAR* Pass);
/**
* Get the data from the XML Files
*
* Returns Boolean if find it
*/
static struct data
{
WCHAR NumProcess[100];
WCHAR Log[100];
WCHAR Pass[100];
WCHAR Mail[100];
WCHAR memLimit[100];
WCHAR CPULimit[100];
}data;
};
在我.cpp文件我已經定義並inizialized數據結構:
int wmain(int argc, WCHAR* argv[])
{
struct XMLReader::data;
wmemcpy(XMLReader::data.Log, L"mama", 50);
wmemcpy(XMLReader::data.Pass, L"am0r3", 50);
wmemcpy(XMLReader::data.CPULimit, L"am0r3", 50);
wmemcpy(XMLReader::data.Mail, L"am0r3", 50);
wmemcpy(XMLReader::data.NumProcess, L"am0r3", 50);
wmemcpy(XMLReader::data.memLimit, L"am0r3", 50);
但我仍然有VS2013錯誤LNK2001:錯誤3錯誤LNK2001:無法解析的外部符號「public:static struct XMLReader :: data XMLReader :: data」(?data @ XMLReader @@ 2U01 @ A)C:\ Users \ Documents \ Visual Studio 2013 \ Projects \ xmlLiteExample \ C++ \ XmlLiteReader.obj xmllitereaderTask 和
錯誤4錯誤LNK1120:1周無法解析的外部C:\用戶\文檔\的Visual Studio 2013 \項目\ xmlLiteExample \ C++ \調試\ xmllitereaderTask.exe xmllitereaderTask
連連呢?
那麼它看起來像'公共'和'靜態'都拼寫錯誤代碼中的某處。 –
哪裏?也許在標題 – kenhero
@kenhero _unresolved external symbol「** punlic **:** stati ** struct XMLReader :: data on .obj_ – erip