Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Link errors when trying to build a program using ticpp (not as library) #66

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. take the code in http://code.google.com/p/ticpp/wiki/BeginersExample , 
include the line 
#define TIXML_USE_TICPP
at the top
2. compile -> ok
3. link -> errors

What is the expected output? What do you see instead?

Expected: successful linking.
Instead: many linker errors of the kind
Undefined symbols:
  "TiXmlString::npos", referenced from:
      TiXmlAttribute::Print(__sFILE*, int, TiXmlString*) constin tinyxml.o
      TiXmlString::find(char, unsigned long) constin tinyxml.o
      TiXmlString::find(char, unsigned long) constin tinyxml.o
etc.

What version of the product are you using? On what operating system?

2.5.3 on OSX 10.6, XCode 3.2.6 (GCC 4.2.1)

Please provide any additional information below.

A workaround I found: add the lines

#ifndef TIXML_USE_TICPP
    #define TIXML_USE_TICPP
#endif

at the top of tinyxml.h and ticpp.cpp.
The problem is apparently that when ticpp.cpp is compiled, TIXML_USE_TICPP is 
not defined yet (because no header file is included before line 24) and thus 
the code following the
#ifdef TIXML_USE_TICPP
in line 24 is excluded.

Original issue reported on code.google.com by [email protected] on 19 Dec 2011 at 9:30

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions