On Fri, 20 Aug 2004 15:58:29 +0200
 Steven Beeckman <[EMAIL PROTECTED]> wrote:

I've checked the latest CVS snapshot from SimGear.org, and even there I find 2 readXML-methods in easyxml.hxx, so that won't be the problem. I've commented out the readXML-method with 3 arguments in easyxml.hxx, which seemed to solve the overloading problem.

So in main.cpp the code looks like this:

ifstream inputfile(argv[2]);
if (!inputfile) {
 cerr << "Could not open autoplot file " << argv[2] << endl << endl;
 exit(-1);
}
plotXMLVisitor myVisitor;
readXML (inputfile, myVisitor);|

Unfortunately, compiling gives this:

| [EMAIL PROTECTED]:~/JSBSim/JSBSim/utilities$ g++ *.cpp -I/usr/local/include/ -L/usr/local/dislin/ -ldislnc -o simplot
main.cpp: In function `int main(int, char**)':
main.cpp:69: could not convert `inputfile' to `const std::string&'
/usr/local/include/simgear/xml/easyxml.hxx:377: in passing argument 1of `void readXML(const std::string&, XMLVisitor&)'
|
Calling readXML with argv[2] instead of inputfile gives (again) an undefined reference about the readXML-method (still commented out the one with 3 arguments). Any ideas how to solve this problem?

Yes, calling readXML() with a char* would not be good - wrong type. However, I am using this form in two applications, and compiling under CygWin, with no problem (this is from a different application that simplot):


  ifstream inputfile(argv[1]);
  if (!inputfile) {
    cerr << "Could not open XML file " << argv[1] << endl << endl;
    exit(-1);
  }
  FGXMLParse myXMLFile;
  readXML (inputfile, myXMLFile);

It seems as if your compiler is choking on the first argument of readXML() not being a const reference to a string. I'm not sure how to solve this. I'll cross-post to flightgear-devel - someone there may have a clue.

Jon

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to