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

  • Home
  • SEARCH
  • 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 8159853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:03:43+00:00 2026-06-06T18:03:43+00:00

In the constructor of an object I have the following code: ConfigReader::ConfigReader(){ TiXmlDocument doc(CONFIGURATION_FILE_LOCATION);

  • 0

In the constructor of an object I have the following code:

ConfigReader::ConfigReader(){
    TiXmlDocument doc(CONFIGURATION_FILE_LOCATION);
    configDoc = TiXmlHandle(&doc);
}

When I try to compile I get the following warning:

no matching funciton for call to 'TiXmlHandle::TiXmlHandle();

configDoc is a TiXmlHandle defined in my h-file as a private variable for the class. Both of the classes are from the TinyXML C++ project, but that’s hardly relevant. The compiler is correct that there is no default constructor for TiXmlHandle. However, since I’m constructing the TiXmlHandle using a valid constructor this, in theory, shouldn’t matter.

So what is the syntax, if any, to tell C++ to not bother trying to create the TiXmlHandle with a default constructor since I’m just going to override it?

I appologize for the simple question, I know that this is the sort of thing I should be able to look up but I’ve tried and not been able to stumble upon the answer.

  • 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-06-06T18:03:44+00:00Added an answer on June 6, 2026 at 6:03 pm

    configDoc is being default constructed and then, later, you are trying to copy assign it to TiXmlHandle(&doc). A TiXmlHandle apparently can’t be default constructed, so this doesn’t work. The default construction is happening implicitly because you haven’t overridden it by using the member initialization list.

    You use the member initialization list like so:

    ConfigReader::ConfigReader()
        : configDoc(/*args*/)
    {
        // ...
    }
    

    Obviously, to pass the proper argument to configDoc in that location you’ll have to restructure your code a bit. Perhaps your TiXmlDocument should be a member too. There are a lot of refactoring options; You can figure that part out yourself.

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

Sidebar

Related Questions

I have the following constructor of an object Segment::Segment(QPointF const& start, QPointF const& end):
I have the following code returning the error 'object' does not contain a constructor
I have the following C++ code that I'm trying to get to compile (relevant
I have the following code #include <iostream> using namespace std; class Object { public:
I have the following code as the constructor of a ViewModel class: [ImportingConstructor] public
I have the following code in my App.xaml.cs private void App_Start(object sender, StartupEventArgs e)
I have two questions about the following code. 1. How to constructor the third
I have the following CoffeeScript code example: class TestClass constructor: () -> @list =
I have following code class Test { public: int &ref; int a; Test(int &x)
So, I have the following code which fails to compile on gcc 4.2.1 on

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.