RapidXML print header has undefined methods

后端 未结 3 1423
终归单人心
终归单人心 2021-02-01 19:58

I\'ve been messing with using RapidXML on one of my projects. It was all going so well until I decided to use it for writing out xml. My code is more or less as follows:

3条回答
  •  你的背包
    2021-02-01 20:15

    For those who come here looking for a solution to the same problem, I have a solution. After looking at http://gcc.gnu.org/gcc-4.7/porting_to.html under "Name lookup changes" (per n.m.'s suggestion) I changed the rapidxml_print.hpp header to have the following right before the declaration of the print_node function (in my file, I inserted this right after line 104):

    template
    inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent);
    
    template
    inline OutIt print_attributes(OutIt out, const xml_node *node, int flags);
    
    template
    inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent);
    
    template
    inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent);
    
    template
    inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent);
    
    template
    inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent);
    
    template
    inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent);
    
    template
    inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent);
    
    template
    inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent);
    

    It now compiles nicely using GCC with a single warning since apparently int flags is unused in the print_attributes function.

提交回复
热议问题