On Sep 29, 2010, at 19:27, Bill Janssen <jans...@parc.com> wrote:
I thought I'd try writing my own version of pdftk with Python. (pdftk
is a C++ wrapper around a Java library that uses gcj to provide the C
++
bindings.) First I have to wrap iText with JCC. I'm using JCC 2.6
from
PyLucene 2.9.1.
% python -m jcc --shared --jar iText.jar --package java.lang --
package java.util --package java.io --python itext --version 5.0.4 --
files 2 --build
[...]
build/_itext/com/itextpdf/text/pdf/PdfName.h:207: error: expected
unqualified-id before numeric constant
You hit a word that's defined as a number in some system header file.
build/_itext/com/itextpdf/text/pdf/PdfName.h:207: error: abstract
declarator ‘com::itextpdf::text::pdf::PdfName*’ used as declarati
on
build/_itext/com/itextpdf/text/pdf/PdfName.h:207: error: expected ‘;
’ before numeric constant
build/_itext/com/itextpdf/text/pdf/PdfName.h:207: error: expected
unqualified-id before numeric constant
build/_itext/com/itextpdf/text/pdf/PdfName.h:207: error: abstract
declarator ‘com::itextpdf::text::pdf::PdfName*’ used as declarati
on
build/_itext/com/itextpdf/text/pdf/PdfName.h:207: error: expected ‘;
’ before numeric constant
lipo: can't open input file: /var/folders/h0/h0Bg3-SkGAmoqGhgtZCaok+
+0T2/-Tmp-//ccyFkD7H.out (No such file or directory)
error: command 'gcc' failed with exit status 1
%
Seems like the offending line is
static PdfName *DOMAIN;
Yes, quite plausible. I think this one has come up before.
To work it around, add --reserved DOMAIN to the command line or add it
to the reserved word list in cpp.py.
Andi..
which comes from this in the Java source:
public class PdfName extends PdfObject implements
Comparable<PdfName> {
...
public static final PdfName DOMAIN = new PdfName("Domain");
}
Assuming DOMAIN is the problem, what's the right way to rename it
out of the way?
I tried adding "--rename
com.itextpdf.text.pdf.PdfName.DOMAIN=DOMAIN_",
with no change.
Bill