这是什么意思?
1>c:\users\vitali\documents\visual studio 2010\projects\salam\tools.cpp(107): error C2084: function 'bool readXMLInteger(xmlNodePtr,const char *,int &)' already has a body
1>c:\users\vitali\documents\visual studio 2010\projects\salam\tools.h(52) : see previous definition of 'readXMLInteger'
Run Code Online (Sandbox Code Playgroud)
tools.cpp(107):
bool readXMLInteger(xmlNodePtr node, const char* tag, int32_t& value)
{
char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag);
if(nodeValue)
{
value = atoi(nodeValue);
xmlFreeXOXL(nodeValue);
return true;
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
的Tools.h(52)
bool readXMLInteger(xmlNodePtr node, const char* tag, int& value);
Run Code Online (Sandbox Code Playgroud)
小智 10
您是否在原始头文件中使用了包含警戒?
例如:
#ifndef _TOOLS_H_
#define _TOOLS_H_
... your header body is here ...
#endif
Run Code Online (Sandbox Code Playgroud)
这阻止了在包含它的每个cpp中重新定义.
归档时间: |
|
查看次数: |
44193 次 |
最近记录: |