I'm on windows but I used a cygwin ldd command on my library but it
gave me a "exec format error", but I tried it with all my libraries
and other than zlib they all got that error. I'm pretty sure the
libraries were compiled properly and are not dll's as the example
helloworlds that are made with the cmake generated visual studio work
fine without any dll's other than zlib1.dll. So even though all my
libraries are static the podofo.lib binary (static version) does not
contain symbols from the static libraries that it depends on (I used a
nm command and piped it to grep).

I can probably deal with separate libraries since the example projects
work fine if I simply link each library separately, ie link to static
podofo.lib and static freetype.lib, static libtiff.lib etc
individually rather than just to podofo.lib which I thought would
contain the other static libraries. Though, I'm still confused why
it's not being bundled despite everything but zlib being static. As
from "If so, then everything is bundled in the resulting binary" I
thought it should be.

Just to double check that there were only podofo objs within my
podofo.lib (I also ran this command on the other libraries which
showed a list of objs, verifying they're all static), running lib
/list podofo.lib resulted in this:

podofo_static.dir\Debug\podofo-doc.res
podofo_static.dir\Debug\PdfArray.obj
podofo_static.dir\Debug\PdfCanvas.obj
podofo_static.dir\Debug\PdfColor.obj
podofo_static.dir\Debug\PdfContentsTokenizer.obj
podofo_static.dir\Debug\PdfData.obj
podofo_static.dir\Debug\PdfDataType.obj
podofo_static.dir\Debug\PdfDate.obj
podofo_static.dir\Debug\PdfDictionary.obj
podofo_static.dir\Debug\PdfEncoding.obj
podofo_static.dir\Debug\PdfEncodingFactory.obj
podofo_static.dir\Debug\PdfEncrypt.obj
podofo_static.dir\Debug\PdfError.obj
podofo_static.dir\Debug\PdfFileStream.obj
podofo_static.dir\Debug\PdfFilter.obj
podofo_static.dir\Debug\PdfFiltersPrivate.obj
podofo_static.dir\Debug\PdfImmediateWriter.obj
podofo_static.dir\Debug\PdfInputDevice.obj
podofo_static.dir\Debug\PdfInputStream.obj
podofo_static.dir\Debug\PdfLocale.obj
podofo_static.dir\Debug\PdfMemStream.obj
podofo_static.dir\Debug\PdfMemoryManagement.obj
podofo_static.dir\Debug\PdfName.obj
podofo_static.dir\Debug\PdfObject.obj
podofo_static.dir\Debug\PdfObjectStreamParserObject.obj
podofo_static.dir\Debug\PdfOutputDevice.obj
podofo_static.dir\Debug\PdfOutputStream.obj
podofo_static.dir\Debug\PdfParser.obj
podofo_static.dir\Debug\PdfParserObject.obj
podofo_static.dir\Debug\PdfRect.obj
podofo_static.dir\Debug\PdfRefCountedBuffer.obj
podofo_static.dir\Debug\PdfRefCountedInputDevice.obj
podofo_static.dir\Debug\PdfReference.obj
podofo_static.dir\Debug\PdfStream.obj
podofo_static.dir\Debug\PdfString.obj
podofo_static.dir\Debug\PdfTokenizer.obj
podofo_static.dir\Debug\PdfVariant.obj
podofo_static.dir\Debug\PdfVecObjects.obj
podofo_static.dir\Debug\PdfWriter.obj
podofo_static.dir\Debug\PdfXRef.obj
podofo_static.dir\Debug\PdfXRefStream.obj
podofo_static.dir\Debug\PdfXRefStreamParserObject.obj
podofo_static.dir\Debug\PdfAcroForm.obj
podofo_static.dir\Debug\PdfAction.obj
podofo_static.dir\Debug\PdfAnnotation.obj
podofo_static.dir\Debug\PdfCMapEncoding.obj
podofo_static.dir\Debug\PdfContents.obj
podofo_static.dir\Debug\PdfDestination.obj
podofo_static.dir\Debug\PdfDifferenceEncoding.obj
podofo_static.dir\Debug\PdfDocument.obj
podofo_static.dir\Debug\PdfElement.obj
podofo_static.dir\Debug\PdfEncodingObjectFactory.obj
podofo_static.dir\Debug\PdfExtGState.obj
podofo_static.dir\Debug\PdfField.obj
podofo_static.dir\Debug\PdfFileSpec.obj
podofo_static.dir\Debug\PdfFont.obj
podofo_static.dir\Debug\PdfFontCID.obj
podofo_static.dir\Debug\PdfFontCache.obj
podofo_static.dir\Debug\PdfFontConfigWrapper.obj
podofo_static.dir\Debug\PdfFontFactory.obj
podofo_static.dir\Debug\PdfFontMetrics.obj
podofo_static.dir\Debug\PdfFontMetricsBase14.obj
podofo_static.dir\Debug\PdfFontMetricsFreetype.obj
podofo_static.dir\Debug\PdfFontMetricsObject.obj
podofo_static.dir\Debug\PdfFontSimple.obj
podofo_static.dir\Debug\PdfFontTTFSubset.obj
podofo_static.dir\Debug\PdfFontTrueType.obj
podofo_static.dir\Debug\PdfFontType1.obj
podofo_static.dir\Debug\PdfFontType3.obj
podofo_static.dir\Debug\PdfFontType1Base14.obj
podofo_static.dir\Debug\PdfFunction.obj
podofo_static.dir\Debug\PdfHintStream.obj
podofo_static.dir\Debug\PdfIdentityEncoding.obj
podofo_static.dir\Debug\PdfImage.obj
podofo_static.dir\Debug\PdfInfo.obj
podofo_static.dir\Debug\PdfMemDocument.obj
podofo_static.dir\Debug\PdfNamesTree.obj
podofo_static.dir\Debug\PdfOutlines.obj
podofo_static.dir\Debug\PdfPage.obj
podofo_static.dir\Debug\PdfPagesTree.obj
podofo_static.dir\Debug\PdfPagesTreeCache.obj
podofo_static.dir\Debug\PdfPainter.obj
podofo_static.dir\Debug\PdfPainterMM.obj
podofo_static.dir\Debug\PdfShadingPattern.obj
podofo_static.dir\Debug\PdfSignOutputDevice.obj
podofo_static.dir\Debug\PdfSignatureField.obj
podofo_static.dir\Debug\PdfStreamedDocument.obj
podofo_static.dir\Debug\PdfTable.obj
podofo_static.dir\Debug\PdfTilingPattern.obj
podofo_static.dir\Debug\PdfXObject.obj

Thanks once again oh wise one (I don't care how humble you are, just
accept that you are smarty)

        Hi,
I'm not that knowledgeable, some parts are related on my experience,
some are guesses.

> Does the podofo library (in my case static) not include the
> libraries like freetype within itself?

I'd say it depends not only whether PoDoFo itself is statically linked,
but also whether its dependencies are static libraries. If so, then
everything is bundled in the resulting binary. If not, then you need
also the other libraries. This looks like your freetype is not a static
library, but a dynamic library. You can see the difference in the
resulting lib size, static libraries are much larger than those dynamic.
Being on a Linux-like system, you can use a tool 'ldd' to see what the
library/executable requires. Just run `ldd libpodogo.lib` and you'll see
its runtime dependencies.

Whether you can use static linking of the dependencies (and PoDoFo
itself) depends on the license you choose for your project. There are
some limitations for static linking, like your project should be Open
Source and some other details I do not recall precisely. You should
search for it, either in the license(s) of the respective projects or on
the Internet.

> In other words are the symbols
> not defined with podofo.lib and I should always directly link the
> various libraries my version of podofo.lib rely's on?

I hope it's answered from the above. Trying to rephrase: static library
can avoid dynamic libraries (extra files for distribution) for that
specific library, it doesn't tell anything about the dependencies of
that library. Thus, if you want a pure static linking, then all the
dependencies the PoDoFo links to should be also static libraries.
        Bye,
        zyx
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to