"... no matching function for call to ‘ofXml::getValue ..."

I’m trying to use “old” addons on Linux with the latest nightly build, and the ofXml class is unhappy.
In testApp.cpp, setting is declared as ofXml settings;
How to fix this error? :

/home/marc/of/nightly/addons/ofxXMPP/example/src/testApp.cpp: In member function ‘virtual void testApp::setup()’:
/home/marc/of/nightly/addons/ofxXMPP/example/src/testApp.cpp:10:51: error: no matching function for call to ‘ofXml::getValue(const char [7])’
         string server = settings.getValue("server");
                                                   ^
In file included from /home/marc/of/nightly/libs/openFrameworks/ofMain.h:22:0,
                 from /home/marc/of/nightly/addons/ofxXMPP/example/src/testApp.h:3,
                 from /home/marc/of/nightly/addons/ofxXMPP/example/src/testApp.cpp:1:
/home/marc/of/nightly/libs/openFrameworks/utils/ofXml.h:166:4: note: candidate: template<class T> T ofXml::getValue() const
  T getValue() const{
    ^~~~~~~~
/home/marc/of/nightly/libs/openFrameworks/utils/ofXml.h:166:4: note:   template argument deduction/substitution failed:
/home/marc/of/nightly/addons/ofxXMPP/example/src/testApp.cpp:10:51: note:   candidate expects 0 arguments, 1 provided
         string server = settings.getValue("server");
                                                   ^
In file included from /home/marc/of/nightly/libs/openFrameworks/ofMain.h:22:0,
                 from /home/marc/of/nightly/addons/ofxXMPP/example/src/testApp.h:3,
                 from /home/marc/of/nightly/addons/ofxXMPP/example/src/testApp.cpp:1:
/home/marc/of/nightly/libs/openFrameworks/utils/ofXml.h:170:14: note: candidate: std::__cxx11::string ofXml::getValue() const
  std::string getValue() const;

Hi @marclava, did you ever get ths working? Have a peek at the documentation for the ofXml class here: https://openframeworks.cc/documentation/utils/ofXml/#show_getValue

The ofXml::getvalue() function does not take any arguments. It returns either a templated type T (so an int, double, float, etc), or a std::string. The compiler is basically saying that it can’t make a templated function that takes a string as an argument. So try calling settings.getValue() instead of settings.getValue(“settings”). I’m thinking that settings (or any instance of an ofXml object) has only 1 value associated with it, and .getValue() returns that value.

I think the correct solution would be to replace:

settings.getValue("server");

with:
settings.getChild("server").getValue();

Hope that helps!
Theo

It seems to work, thanks.