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 3799404
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:43:38+00:00 2026-05-19T13:43:38+00:00

Hey, i’m really trying to get TinyXML to at least read a file but

  • 0

Hey, i’m really trying to get TinyXML to at least read a file but it says “main.cpp:8: error: ‘TiXMLDocument’ was not declared in this scope”

This is the code im using:

TiXMLDocument("demo.xml");

Ideally i want to read able to read files and output the XML so i also tried this code i found online in a tutorial

#include <iostream>

#include "tinyxml.h"
#include "tinystr.h"

void dump_to_stdout(const char* pFilename)
{
    TiXmlDocument doc(pFilename);
    bool loadOkay = doc.LoadFile();
    if (loadOkay)
    {
        printf("\n%s:\n", pFilename);
        dump_to_stdout( &doc ); // defined later in the tutorial
    }
    else
    {
        printf("Failed to load file \"%s\"\n", pFilename);
    }
}

int main(void)
{
    dump_to_stdout("demo.xml");
    return 0;
}

And the errors I’m getting now are:

main.cpp: In function ‘void dump_to_stdout(const char*)’:
main.cpp:13: error: cannot convert ‘TiXmlDocument*’ to ‘const char*’ for argument ‘1’ to ‘void dump_to_stdout(const char*)’

If it helps im on a mac, ive tried compiling in terminal as well as textmate. I also tried to compile the cpp files for TinyXML separately before compiling main.cpp and i have no idea why i cant print out demo.xml let alone read it.

  • 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-19T13:43:38+00:00Added an answer on May 19, 2026 at 1:43 pm
    1. It’s called TiXmlDocument, not TiXMLDocument
    2. You can’t call a function that you haven’t declared yet. Since you’re trying to call an undeclared overload of dump_to_stdout, the compiler assumes you want to call the version that takes const char * and fails.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, am trying to write to do type casting in java, but i
Hey, I'm trying to get the source code of an app similar to the
Hey, I'm using Levenshteins algorithm to get distance between source and target string. also
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Hey having some trouble trying to maintain transparency on a png when i create
Hey there, I'm at the moment trying to make a product management application. The
Hey guys. I'm not much of a programmer, but still need to do some
Hey guys, I have a little button functionality that is not erring, but also
Hey guys. I'm trying to configure TFS2010 on a home server. I want to
Hey, I'm trying to make an Address book for my site and I was

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.