maybe it's because of the way that person used your code. I just had a look at avSvnRevision.h/cpp
-> include "tinyxml/tinystr.h", the fact that you specify a subdir, could be the party pooper.
Some advice to the code of avSvnRevision.h
- never ever put using namespace in a header file
- the include's of tinyxml are NOT needed here -> you don't do anything with them in the header, so they do NOT belong there
- the include of cstdio does not belong here, inside the header you use NOTHING from that header file
Core new code suggestion :
#include <string>
bool QuerySvn(const std::string& workingDir, std::string& revision, std::string& date);
I also had a look at the corresponding cpp file :
here you should put the includes of :
- cstddio.h
- tinyxml.h (probably tinystr.h is not needed) (suggestion : don't put an extra dir in front, just add the dir to your include paths of the project
Things that can be removed from this file are :
- the include of wx.h [you don't use anything from wxwidgets in this code, aside use the headers with the things you actually use from wx, don't just include a monster of a header file]
- remove the macro (by the way don't use macros, they are f*** BAD, use a function, a template, ...], but in this case the macro is not used
Other suggestions :
- be const correct and scope limiting : your TinyXmlElement's are const --> put that in the code, and limit their scope, also make use of handle, it will simplify your code
TiXmlHandle Handle(&doc);
if(const TiXmlElement* e = Handle.FirstChildElement("entry").FirstChildElement("commit").ToElement())
{
revision = e->Attribute("revision") ? e->Attribute("revision") : "";
const TiXmlElement *d = e->FirstChildElement("date");
if(d && d->GetText())
{
date = d->GetText();
}
}
- don't use memset when it is not needed, you can easily replace :
char buf[16384];
memset(buf, 0, 16384);
by :
char buf[16384] = {'\0'};
- try to avoid magic numbers like '16384' and '16384' and '16383, for sure they are all related, but are they ..., put that magic number in a const variable (no define !!!)
I hope you find these tips and code corrections useful. I didn't look at the other source files, I just took a peek for this one wrt compile problem.
Cheers.