Menu

including tinyxml files (VC6)

2003-03-10
2003-03-19
  • - 2003-03-10

    How to include tinyxml files into my project in visual c++ 6?
    Demo compiles properly, but when I create my own project, add instruction to include tinyxml.h and add files: tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, and tinystr.cpp to project, I get errors:
    --------------------
    Compiling...
    tinyxml.cpp
    D:\Visual Studio 6\MyProjects\kombinacje\tinyxml.cpp(1069) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    tinyxmlerror.cpp
    D:\Visual Studio 6\MyProjects\kombinacje\tinyxmlerror.cpp(51) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    tinyxmlparser.cpp
    D:\Visual Studio 6\MyProjects\kombinacje\tinyxmlparser.cpp(940) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    tinystr.cpp
    D:\Visual Studio 6\MyProjects\kombinacje\tinystr.cpp(266) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    --------------------

    When I only include tinyxml.h, I get errors:
    --------------------
    Linking...
    kombinacje.obj : error LNK2001: unresolved external symbol "protected: virtual class TiXmlNode * __thiscall TiXmlDocument::Clone(void)const " (?Clone@TiXmlDocument@@MBEPAVTiXmlNode@@XZ)
    kombinacje.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall TiXmlDocument::StreamOut(class TiXmlOutStream *)const " (?StreamOut@TiXmlDocument@@MBEXPAVTiXmlOutStream@@@Z)
    kombinacje.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TiXmlDocument::Print(struct _iobuf *,int)const " (?Print@TiXmlDocument@@UBEXPAU_iobuf@@H@Z)
    kombinacje.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall TiXmlNode::~TiXmlNode(void)" (??1TiXmlNode@@UAE@XZ)
    kombinacje.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlDocument::Parse(char const *)" (?Parse@TiXmlDocument@@UAEPBDPBD@Z)
    kombinacje.obj : error LNK2001: unresolved external symbol "public: __thiscall TiXmlDocument::TiXmlDocument(char const *)" (??0TiXmlDocument@@QAE@PBD@Z)
    Release/kombinacje.exe : fatal error LNK1120: 6 unresolved externals
    --------------------

    It should be simple to solve, but not for beginner :(
    Thanks in advance

     
    • Vaclav Jedlicka

      Vaclav Jedlicka - 2003-03-12

      add  #include "stdafx.h" as the first command in the .cpp files

       
    • Anonymous

      Anonymous - 2003-03-19

      ... and the second way is to switch off using of precompiled headers for TinyXML's .cpp files (Project Settings -> C/C++ tab -> category (combo) "Precompiled headers" -> option "Not using precompiled headers").

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.