PO Box 1214 • La Pine • Oregon • 97739 • 541-410-2760

 

M
a
i
n

Home

  • Tech Notes
  • Showcase
  • What We Do
  • Downloads
  • Store
  • IMO
  • Contact Us
  •  
    mbtPdfAsm G++ 4.3 Compatibility Patch

    mbtPdfAsm G++ 4.3 Compatibility Patch

    by Jon Foster - 2010-04-26
    Updated: 2019-04-26
     

    I've used mbtPdfAsm to script the assembly of multiple PDF documents on the fly. Its been a handy tool and one that I have websites that rely on. Recently I tried to re-compile this code for use on a Debian Lenny (5) system. It uses GCC/G++ 4.3. Apparently there are some syntactical errors that previous versions of G++ ignored. So when I ran "make" on my Debian system I ended up with:

     

    pdfString.hpp:16: error: extra qualification 'pdfString::' on member 'pdfString'
    pdfString.hpp:18: error: extra qualification 'pdfString::' on member 'pdfString'
    pdfString.hpp:22: error: extra qualification 'pdfString::' on member 'copy'
    pdfString.hpp:24: error: extra qualification 'pdfString::' on member 'copy'
    pdfString.hpp:26: error: extra qualification 'pdfString::' on member 'copy'
    

     

    So I came up with a simple patch (for v1.0.26) to allow this to work on more recent C++ compilers:

     

    diff -ru mbtPdfAsm-1.0.26-org/pdfString.hpp mbtPdfAsm-1.0.26-new/pdfString.hpp
    --- mbtPdfAsm-1.0.26-org/pdfString.hpp	2003-12-16 11:18:24.000000000 -0800
    +++ mbtPdfAsm-1.0.26-new/pdfString.hpp	2010-04-24 11:08:41.000000000 -0700
    @@ -13,17 +13,17 @@
        int maxLength;
        char *value;
     public:
    -   pdfString::pdfString();
    +   pdfString();
        pdfString(const char *src);
    -   pdfString::~pdfString();
    +   ~pdfString();
     
        /* copie une chaine dans value en utilisant le premier caractère [ ou ( pour déterminer si il s'agit
        d'un chaine hexa ou car*/
    -   int pdfString::copy(const char *);
    +   int copy(const char *);
        /* copie une chaine dans value en utilisant int comme longeuer à copier*/
    -   int pdfString::copy(const char *, int, stringType);
    +   int copy(const char *, int, stringType);
        /* copie la chaine org dans la chaine this */
    -   int pdfString::copy(const pdfString *org);
    +   int copy(const pdfString *org);
        int snprint(char *dest, int lg, bool printable); // printable = true si on veut une version affichable de la chaine cela n'et utile que dans le cas d'une chaine hexa
        bool compare(char *c, int lg);
    

     

    I now have mbtPdfAsm happily running on my Debian installs.

    *NOTE* I believe the latest version, as of this writing, 1.0.28, is capable of being compiled without this patch.