diff --git a/Graphics/PDF/Data/PDFTree.hs b/Graphics/PDF/Data/PDFTree.hs
--- a/Graphics/PDF/Data/PDFTree.hs
+++ b/Graphics/PDF/Data/PDFTree.hs
@@ -1,4 +1,4 @@
-{-# OPTIONS -cpp -fglasgow-exts -fno-bang-patterns #-} 
+{-# OPTIONS -cpp -fglasgow-exts -XNoBangPatterns #-} 
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  PDFTree.hs
diff --git a/Graphics/PDF/Data/Trie.hs b/Graphics/PDF/Data/Trie.hs
--- a/Graphics/PDF/Data/Trie.hs
+++ b/Graphics/PDF/Data/Trie.hs
@@ -25,6 +25,13 @@
                  | Trie (Maybe v) (M.Map Char (MapString v))
                  deriving(Eq,Show)
                  
+#if __GLASGOW_HASKELL__ >= 610
+myLookup :: Ord k => k -> M.Map k a ->[a]
+myLookup k d = case M.lookup k d of
+    Just r -> [r]
+    _ -> []
+#endif
+                 
 fromList :: [(String,v)] -> MapString v
 fromList = foldr addElem EmptyTrie
  where
@@ -36,8 +43,13 @@
 lookup _ EmptyTrie = []
 lookup [] (Trie (Just a) _) = [a]
 lookup [] (Trie Nothing _) = []
+#if __GLASGOW_HASKELL__ >= 610
+lookup (c:s) (Trie Nothing tc) = (myLookup c tc >>= lookup s)
+lookup (c:s) (Trie (Just tn) tc) = tn:(myLookup c tc >>= lookup s)
+#else
 lookup (c:s) (Trie Nothing tc) = (M.lookup c tc >>= lookup s)
 lookup (c:s) (Trie (Just tn) tc) = tn:(M.lookup c tc >>= lookup s)
+#endif
    
 insert :: String
        -> v
diff --git a/Graphics/PDF/Image.hs b/Graphics/PDF/Image.hs
--- a/Graphics/PDF/Image.hs
+++ b/Graphics/PDF/Image.hs
@@ -41,6 +41,10 @@
 import Data.Binary.Builder(Builder,fromLazyByteString)
 import Control.Exception as E
 
+#if __GLASGOW_HASKELL__ >= 610
+import Control.OldException(ioErrors)
+#endif
+
 m_sof0 :: Int
 m_sof0 = 0xc0 
 m_sof1 :: Int 
diff --git a/HPDF.cabal b/HPDF.cabal
--- a/HPDF.cabal
+++ b/HPDF.cabal
@@ -1,6 +1,6 @@
 Name: HPDF
-Version: 1.4
-cabal-version: >=1.2
+Version: 1.4.1
+cabal-version: >=1.6
 License: LGPL
 License-file:LICENSE
 Copyright: Copyright (c) 2007-2008, alpheccar
@@ -8,7 +8,7 @@
 synopsis: Generation of PDF documents
 maintainer: misc@NOSPAMalpheccar.org
 build-type: Simple
-tested-with: GHC==6.8.1
+tested-with: GHC==6.8.1, GHC==6.10.1
 homepage: http://www.alpheccar.org
 description: A PDF library with support for several pages, page transitions, outlines, annotations, compression, colors, shapes, patterns, jpegs, fonts, typesetting ...
 extra-source-files:
@@ -29,9 +29,9 @@
 
 library
   if flag(splitBase)
-    build-depends: base >= 3, containers, random >= 1.0, bytestring >= 0.9, array >= 0.1, zlib >= 0.3, binary >= 0.3, mtl
+    build-depends: base >= 4 , containers, random >= 1.0, bytestring >= 0.9, array >= 0.1, zlib >= 0.5, binary >= 0.4, mtl
   else
-    build-depends: base, haskell98, mtl ,zlib >= 0.3, binary >= 0.3
+    build-depends: base >= 3, haskell98, mtl ,zlib >= 0.5, binary >= 0.4
   ghc-options: -Wall -funbox-strict-fields  -O2
   extensions: 
     FlexibleInstances, 
diff --git a/Test/Makefile b/Test/Makefile
--- a/Test/Makefile
+++ b/Test/Makefile
@@ -1,8 +1,8 @@
 debug:
-	ghc -o test -ffi -cpp -Wall -funbox-strict-fields  -fglasgow-exts  -O2 -hidir interfaces -odir bin -optc-I../c -i.. ../c/metrics.c ../c/conversion.c --make test.hs
+	ghc -o test -XForeignFunctionInterface -cpp -Wall -funbox-strict-fields  -fglasgow-exts  -O2 -hidir interfaces -odir bin -optc-I../c -i.. ../c/metrics.c ../c/conversion.c --make test.hs
 
 profile:
-	ghc -o test -prof -auto-all -ffi -cpp -Wall -funbox-strict-fields  -fglasgow-exts  -O2 -hidir interfaces -odir bin -optc-I../c -i..  ../c/metrics.c ../c/conversion.c --make test.hs
+	ghc -o test -prof -auto-all -XForeignFunctionInterface -cpp -Wall -funbox-strict-fields  -fglasgow-exts  -O2 -hidir interfaces -odir bin -optc-I../c -i..  ../c/metrics.c ../c/conversion.c --make test.hs
 	
 runprof:
 	./test +RTS -p -hc
