Index: src/base/PdfImmediateWriter.cpp
===================================================================
--- src/base/PdfImmediateWriter.cpp	(revision 1894)
+++ src/base/PdfImmediateWriter.cpp	(working copy)
@@ -138,7 +138,7 @@
         trailer.WriteObject( m_pDevice, this->GetWriteMode(), NULL );
     }
     
-    m_pDevice->Print( "startxref\n%li\n%%%%EOF\n", lXRefOffset );
+    m_pDevice->Print( "startxref\n%" PDF_FORMAT_INT64 "\n%%%%EOF\n", lXRefOffset );
     m_pDevice->Flush();
 
     // we are done now
Index: src/base/PdfObjectStreamParserObject.cpp
===================================================================
--- src/base/PdfObjectStreamParserObject.cpp	(revision 1894)
+++ src/base/PdfObjectStreamParserObject.cpp	(working copy)
@@ -118,7 +118,7 @@
         {
 			if(m_vecObjects->GetObject(PdfReference( static_cast<int>(lObj), PODOFO_LL_LITERAL(0) ))) 
             {
-                PdfError::LogMessage( eLogSeverity_Warning, "Object: %li 0 R will be deleted and loaded again.\n", lObj );
+                PdfError::LogMessage( eLogSeverity_Warning, "Object: %" PDF_FORMAT_INT64 " 0 R will be deleted and loaded again.\n", lObj );
                 delete m_vecObjects->RemoveObject(PdfReference( static_cast<int>(lObj), PODOFO_LL_LITERAL(0) ),false);
             }
             m_vecObjects->insert_sorted( new PdfObject( PdfReference( static_cast<int>(lObj), PODOFO_LL_LITERAL(0) ), var ) );
Index: src/base/PdfParser.cpp
===================================================================
--- src/base/PdfParser.cpp	(revision 1894)
+++ src/base/PdfParser.cpp	(working copy)
@@ -614,7 +614,7 @@
             throw e;
         }
 #ifdef PODOFO_VERBOSE_DEBUG
-        PdfError::DebugMessage("Size=%li\n", m_pTrailer->GetDictionary().GetKeyAsLong( PdfName::KeySize, 0 ) );
+        PdfError::DebugMessage("Size=%" PDF_FORMAT_INT64 "\n", m_pTrailer->GetDictionary().GetKeyAsLong( PdfName::KeySize, 0 ) );
 #endif // PODOFO_VERBOSE_DEBUG
     }
 }
Index: src/base/PdfWriter.cpp
===================================================================
--- src/base/PdfWriter.cpp	(revision 1894)
+++ src/base/PdfWriter.cpp	(working copy)
@@ -196,7 +196,7 @@
                 trailer.WriteObject( pDevice, m_eWriteMode, NULL ); // Do not encrypt the trailer dictionary!!!
             }
             
-            pDevice->Print( "startxref\n%li\n%%%%EOF\n", pXRef->GetOffset() );
+            pDevice->Print( "startxref\n%" PDF_FORMAT_UINT64 "\n%%%%EOF\n", pXRef->GetOffset() );
             delete pXRef;
         } catch( PdfError & e ) {
             // Make sure pXRef is always deleted
Index: test/CreationTest/CreationTest.cpp
===================================================================
--- test/CreationTest/CreationTest.cpp	(revision 1894)
+++ test/CreationTest/CreationTest.cpp	(working copy)
@@ -845,9 +845,9 @@
 
         printf("PoDoFo DataType Size Information:\n");
         printf("---\n");
-        printf("sizeof variant=%lu\n", sizeof(PdfVariant) );
-        printf("sizeof object=%lu\n", sizeof(PdfObject) );
-        printf("sizeof reference=%lu\n", sizeof(PdfReference) );
+        printf("sizeof variant=%lu\n", static_cast<unsigned>(sizeof(PdfVariant)) );
+        printf("sizeof object=%lu\n", static_cast<unsigned>(sizeof(PdfObject)) );
+        printf("sizeof reference=%lu\n", static_cast<unsigned>(sizeof(PdfReference)) );
         printf("---\n\n");
 
         outlines = writer.GetOutlines();
Index: test/FilterTest/FilterTest.cpp
===================================================================
--- test/FilterTest/FilterTest.cpp	(revision 1894)
+++ test/FilterTest/FilterTest.cpp	(working copy)
@@ -97,9 +97,9 @@
         }
     }
 
-    printf("\t-> Original Data Length: %li\n", lTestLength );
-    printf("\t-> Encoded  Data Length: %li\n", lEncoded );
-    printf("\t-> Decoded  Data Length: %li\n", lDecoded );
+    printf("\t-> Original Data Length: %" PDF_FORMAT_INT64 "\n", lTestLength );
+    printf("\t-> Encoded  Data Length: %" PDF_FORMAT_INT64 "\n", lEncoded );
+    printf("\t-> Decoded  Data Length: %" PDF_FORMAT_INT64 "\n", lDecoded );
 
     if( static_cast<pdf_long>(lTestLength) != lDecoded )
     {
@@ -168,8 +168,8 @@
     pDecoded = stream2.TakeBuffer();
 
     printf("\t-> Original Data Length: %li\n", lLen );
-    printf("\t-> Encoded  Data Length: %li\n", lEncoded );
-    printf("\t-> Decoded  Data Length: %li\n", lDecoded );
+    printf("\t-> Encoded  Data Length: %" PDF_FORMAT_INT64 "\n", lEncoded );
+    printf("\t-> Decoded  Data Length: %" PDF_FORMAT_INT64 "\n", lDecoded );
 
     if( lDecoded != lLen )
     {
@@ -205,9 +205,9 @@
     stream.Set( const_cast<char*>(pBuffer), lLen );
     stream.GetFilteredCopy( &pDecoded, &lDecoded );
 
-    printf("\t-> Original Data Length: %li\n", lLen );
-    printf("\t-> Encoded  Data Length: %lu\n", stream.GetLength() );
-    printf("\t-> Decoded  Data Length: %li\n", lDecoded );
+    printf("\t-> Original Data Length: %" PDF_FORMAT_INT64 "\n", lLen );
+    printf("\t-> Encoded  Data Length: %" PDF_FORMAT_UINT64 "\n", stream.GetLength() );
+    printf("\t-> Decoded  Data Length: %" PDF_FORMAT_INT64 "\n", lDecoded );
 
     if( lDecoded != lLen )
     {
@@ -275,8 +275,8 @@
         if( static_cast<pdf_long>(strlen(pszInputAscii85Lzw)) != lLargeBufer2 )
         {
             fprintf( stderr, "ROACH Error: Decoded Length != Original Length\n");
-            fprintf( stderr, "ROACH Original: %li\n", strlen(pszInputAscii85Lzw) );
-            fprintf( stderr, "ROACH Encode: %li\n", lLargeBufer2 );
+            fprintf( stderr, "ROACH Original: %li\n", static_cast<unsigned>(strlen(pszInputAscii85Lzw)) );
+            fprintf( stderr, "ROACH Encode: %" PDF_FORMAT_INT64 "\n", lLargeBufer2 );
             PODOFO_RAISE_ERROR( ePdfError_TestFailed );
         }
 
Index: tools/podofoimgextract/ImageExtractor.cpp
===================================================================
--- tools/podofoimgextract/ImageExtractor.cpp	(revision 1894)
+++ tools/podofoimgextract/ImageExtractor.cpp	(working copy)
@@ -118,7 +118,7 @@
         // TODO: Handle colorspaces
 
         // Create a ppm image
-        const char* pszPpmHeader = "P6\n# Image extracted by PoDoFo\n%li %li\n%li\n";
+        const char* pszPpmHeader = "P6\n# Image extracted by PoDoFo\n%" PDF_FORMAT_INT64 " %" PDF_FORMAT_INT64 "\n%li\n";
         
         
         fprintf( hFile, pszPpmHeader, 
