Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6355449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:46:03+00:00 2026-05-24T22:46:03+00:00

This is just a simple header file used to parse XML with the Xerces

  • 0

This is just a simple header file used to parse XML with the Xerces Parser. I’m banging my head trying to figure this one out, but for whatever reason, the compiler is complaining about things which shouldn’t be an issue. I need a second reference to look this over and tell me what’s happening.

#include "xerces_string.h"

using namespace std;
#ifndef CHARACTER_H
#define CHARACTER_H
struct Character
{
    XercesString m_Name;
public:
    Character();
    Character(const Character &copy) : m_Name(copy.m_Name)     {

    };

    Character(const XMLCh *wstring) : m_Name(wstring) {};

    virtual ~Character() {};

};

class GraphHandler : public DefaultHandler {
    XercesString m_Name;
    std::vector<Character> m_List;

public:
    virtual void start_document();

    virtual void end_document();

    virtual void start_element(
        const XMLCh * const uri,
        const XMLCh * const localname,
        const XMLCh * const qname,
        const Attributes& attributes
    );

    virtual void end_element(
        const XMLCh * const uri,
        const XMLCh * const localname,
        const XMLCh * const qname
    );

    virtual void characters(
        const XMLCh * const chars,
        const unsigned int length
    );
}
#endif

Here is my execution file:

#include </usr/include/xercesc/sax2/SAX2XMLReader.hpp>
#include </usr/include/xercesc/sax2/XMLReaderFactory.hpp>
#include </usr/include/xercesc/sax2/ContentHandler.hpp>
#include </usr/include/xercesc/sax2/DefaultHandler.hpp>
#include </usr/include/xercesc/sax2/Attributes.hpp>
#include </usr/include/xercesc/util/PlatformUtils.hpp>
#include <stdio.h>

#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#endif

#include "character.h"
#include "xerces_string.h"

int main(int argc, char* argv[])
{
    //initialize the XML library
    XMLPlatformUtils::Initialize();
    XMLPlatformUtils::Terminate();
}

Here’s my output:

    In file included from main.cpp:15:
character.h:6: error: expected unqualified-id before ‘using’
character.h: In constructor ‘Character::Character(const XMLCh*)’:
character.h:18: error: no matching function for call to ‘XercesString::XercesString(const XMLCh*&)’
xerces_string.h:5: note: candidates are: XercesString::XercesString()
xerces_string.h:5: note:                 XercesString::XercesString(const XercesString&)
character.h: At global scope:
character.h:24: error: expected class-name before ‘{’ token
character.h:26: error: ISO C++ forbids declaration of ‘vector’ with no type
character.h:26: error: expected ‘;’ before ‘<’ token
character.h:37: error: ISO C++ forbids declaration of ‘Attributes’ with no type
character.h:37: error: expected ‘,’ or ‘...’ before ‘&’ token
character.h:24: error: new types may not be defined in a return type
character.h:24: note: (perhaps a semicolon is missing after the definition of ‘GraphHandler’)
main.cpp:18: error: two or more data types in declaration of ‘main’

My xercesc directory DOES exist in the paths given. I compiled XercesC from source, and I have no idea what I’m doing. I’m also new to C++.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:46:04+00:00Added an answer on May 24, 2026 at 10:46 pm

    I can’t debug your filesystem issues. It would, however, be not difficult for me to do some translation of the errors.

    Compiler says:

    character.h:6: error: expected unqualified-id before ‘using’
    character.h: In constructor ‘Character::Character(const XMLCh*)’:
    character.h:18: error: no matching function for call to ‘XercesString::XercesString(const XMLCh*&)’
    xerces_string.h:5: note: candidates are: XercesString::XercesString()
    xerces_string.h:5: note:                 XercesString::XercesString(const XercesString&)
    character.h: At global scope:
    character.h:24: error: expected class-name before ‘{’ token
    character.h:26: error: ISO C++ forbids declaration of ‘vector’ with no type
    character.h:26: error: expected ‘;’ before ‘<’ token
    character.h:37: error: ISO C++ forbids declaration of ‘Attributes’ with no type
    character.h:37: error: expected ‘,’ or ‘...’ before ‘&’ token
    character.h:24: error: new types may not be defined in a return type
    character.h:24: note: (perhaps a semicolon is missing after the definition of ‘GraphHandler’)
    main.cpp:18: error: two or more data types in declaration of ‘main’
    

    Compiler means:

    Help!
    When you tried to use something, I didn’t find the thing you attempted to use- i.e., I don’t know of any namespace “std”.
    You tried to
    construct a XercesString from a const XMLCh*, but I couldn’t find a constructor that could take that.

    You left the semicolon off the end of the GraphHandler definition, so I don’t know how to understand the next stuff you wrote.

    You put semicolons at the end of functions of the Character struct.

    The other errors could well be a simple lack of having the right types declared, but they could also be other errors. I can’t know without you showing the source of main.cpp.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is just a simple question. I've been reading the source of something which
[see later answer for more] I think this is just a simple rails question,
Best explained with code I think, this is just a simple example: public class
Below just a simple race between 2 button in 2 threads, and this will
I just tossed this super simple code example into a Flash CS4 IDE frame
This might be a simple question but I'm just picking this up so please
This simple Python method I put together just checks to see if Tomcat is
I have this simple test project just to test the IncludeExceptionDetailInFaults behavior. public class
I just want to design this very simple website. Basically there are multiple pages
This should be a simple question, but I just can't recall the relevant API.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.