leethomason/tinyxml2 — Issue #1: Compiling under GNU/Linux not possible
Author: retr0virus
Created: 2012-03-06 16:13:59+00:00
State: open

Hello,
I tried to compile tinyxml2 with archlinux with the standard g++ (GCC) 4.6.2 20120120 (prerelease)
but I get the error that ptrdiff_t was not declared in this scope.
I changed some headers from old c-headers to the modern c++ headers (I think you recommend the use of g++ anyway because everywhere in your code you are using g++ instead of gcc - so it should be ok?).
I think especially including fixes the problem (memory.h seems not to be needed) - it compiles with this change and it seems to have no side effects for my example xml.
Only adding (old c-header) works too.

Compiler call and error output: http://pastebin.com/5CCxY40B
Patch for tinyxml2.h: http://pastebin.com/9r2WBG3u

The .cpp-headers should possibly changed too?