--- librevenge-0.0.3/src/lib/RVNGTextTextGenerator.cpp	Sat Aug 29 22:03:12 2015
+++ librevenge-0.0.3/src/lib/RVNGTextTextGenerator.cpp	Thu Mar 03 21:17:29 2016
@@ -19,7 +19,6 @@
  */
 
 #include <sstream>
-
 #include <librevenge-generators/librevenge-generators.h>
 
 // use the BELL code to represent a TAB for now
@@ -123,7 +122,7 @@
 	if (!m_impl->m_endnotes.str().empty())
 	{
 		*m_impl->m_stream << '\n';
-		*m_impl->m_stream << m_impl->m_endnotes;
+		*m_impl->m_stream << m_impl->m_endnotes.str();
 	}
 	m_impl->m_document=m_impl->m_stream->str().c_str();
 }
--- librevenge-0.0.3/src/lib/RVNGZipStream.cpp	Wed Dec 23 10:50:32 2015
+++ librevenge-0.0.3/src/lib/RVNGZipStream.cpp	Thu Mar 03 20:36:53 2016
@@ -21,6 +21,7 @@
 #include <string>
 #include <string.h>
 #include <stdio.h>
+#include <algorithm>
 #include <utility>
 
 #include <zlib.h>
--- poppler-0.39.0/poppler/PSOutputDev.cc	Wed Dec 16 14:58:32 2015
+++ poppler-0.39.0/poppler/PSOutputDev.cc	Thu Mar 03 20:36:33 2016
@@ -41,11 +41,11 @@
 #ifdef USE_GCC_PRAGMAS
 #pragma implementation
 #endif
-
 #include <stdio.h>
 #include <stddef.h>
 #include <stdarg.h>
 #include <signal.h>
+#include <algorithm>
 #include <math.h>
 #include <limits.h>
 #include "goo/GooString.h"
--- poppler-0.39.0/poppler/TextOutputDev.cc	Sun Nov 15 13:05:22 2015
+++ poppler-0.39.0/poppler/TextOutputDev.cc	Thu Mar 03 20:37:04 2016
@@ -50,6 +50,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
+#include <algorithm>
 #include <math.h>
 #include <float.h>
 #include <ctype.h>
