我正在尝试建立一个程序,希望能创建动态.pdf文件。我实际上已经用PHP开发了一个类似的web项目,但现在我想用C++编写它。
这导致我在过去四天内重建这三个库(zlib、libpng和libharu)的次数超过了时间。我已经阅读了web上的所有相关条目(包括this堆栈溢出条目),我知道我的问题是编译器找不到zlib (也许我理解错了)
我想解释一下我做了什么。请注意,我在Windows7中使用的是Codeblocks和GNU GCC C++编译器(MingGW)。首先,我编译了zlib1.2.7并创建了我的zlib.a静态库文件(我使用的是静态库)。其次,我编译了libpng 1.5.13并创建了我的libpng.a。第三,我编译了libharu (快照)并创建了我的libharu.a静态库文件。然后我将这些库文件添加到我的项目中。(我做了here中解释的所有事情)。最后,编译了我的项目。
好吧,我应该说我把所有的步骤都做了十多次,改变了一些小东西,但每次我都得到一个错误。我甚至尝试过libharu.org中的官方示例。最奇怪的是我的错误并不稳定。几乎每次我都会得到不同的错误!但大多数情况下与hpdf_streams.c有关。
我最近的日志文件:
C:\Libs\libharu-201301131604\libharu.a(hpdf_streams.o):hpdf_streams.c:(.text+0xd4a): undefined reference to `deflateInit_'
C:\Libs\libharu-201301131604\libharu.a(hpdf_streams.o):hpdf_streams.c:(.text+0xdfa): undefined reference to `deflate'
C:\Libs\libharu-201301131604\libharu.a(hpdf_streams.o):hpdf_streams.c:(.text+0xe78): undefined reference to `deflateEnd'
C:\Libs\libharu-201301131604\libharu.a(hpdf_streams.o):hpdf_streams.c:(.text+0xee2): undefined reference to `deflate'
C:\Libs\libharu-201301131604\libharu.a(hpdf_streams.o):hpdf_streams.c:(.text+0xf7e): undefined reference to `deflateEnd'
C:\Libs\libharu-201301131604\libharu.a(hpdf_streams.o):hpdf_streams.c:(.text+0xfb7): undefined reference to `deflateEnd'
C:\Libs\libharu-201301131604\libharu.a(hpdf_streams.o):hpdf_streams.c:(.text+0xff1): undefined reference to `deflateEnd'发布于 2013-02-07 03:49:21
我们刚刚遇到了这个问题。您需要在关闭WIN_API的情况下重新编译zlib。或者使用dll而不是静态库。
https://stackoverflow.com/questions/14303851
复制相似问题