Getting ticpp to compile on Mac OS X with Xcode

92 views
Skip to first unread message

Leroy

unread,
Jun 22, 2009, 5:47:45 PM6/22/09
to TinyXML++
First off, some info:
Our development environment is Apple Xcode on Mac OS X 10.5, with GCC
4.0
SVN revision 106 of ticpp

I am working on a game project, and was looking for something "easy"
to use so we can read and write xml files. I stumbled upon TinyXML,
and TinyXML++.

I really like the way ticpp works, so I tried to build it.
The first problem that I ran into was that premake has been updated to
version 4.1, but ticpp doesn't work with it out of the box. I then
tried premake 3.7, And luckily, I was able to build it by following
the linux/GNU build instructions.

I then proceeded to add the headers + library file to my empty C++
Xcode project, this automatically links the project with the
libticpp.a which I compiled from source as described above.

To verify that everything was in working order, I then moved on to
paste some tutorial code from the site, which is located at
http://code.google.com/p/ticpp/wiki/BeginersExample
The example code didn't compile, throwing a bunch of errors at me.

I then noticed this comment:
As of version 0.04a if you don't "#define TIXML_USE_TICPP" this will
not compile...
So I added the define in my main.cpp below the includes

The code still refused to compile, until I moved the define ABOVE the
#include of ticpp.h, and was able to use ticpp from then on!

One thing that was a bit confusing though, was that it's not mentioned
which files to include in most of the example code, apart from the
beginners example.

I actually got stuck getting the code to compile, which was my
motivation to write this message, but was able to figure it out (after
a few hours of trying) while writing it . I hope that it's useful to
someone ; )

Ryan Pusztai

unread,
Jun 22, 2009, 9:25:33 PM6/22/09
to ti...@googlegroups.com
Thanks for a complete message. I have a request, can you add a wiki article on Compiling in Mac? We (the main developers don't have access to a Mac.) Also you can update any unclear documentation in the Beginners tutorial to make it easier for others. Sometimes the worst people to write documentation are the main developers, we can be too close to the project to see that some simple, but critical parts are missing.

Again thanks for the feedback. Let me know how your experience goes.
--
Regards,
Ryan
Reply all
Reply to author
Forward
0 new messages