Skip to content
This repository has been 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

Open
GoogleCodeExporter opened this issue Mar 17, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant