Does anyone have any experience with PODOFO Click Here.
I've read everything they have to offer and I admit, some of their points are a little advance for me.
I'm trying to determine whether PoDoFo can be compiled as part of my c++ application so that my application is standalone. OR, do I have to ship something with it in order to use the PoDoFo functionality.

There is a section in it's documentation which says the below:

Remember that you must ship zlib1.dll with your application. During testing it must be in the same directory as the PoDoFo-using executable or the directory containing it must be on your system PATH.

Does this mean I always have to ship this dll with my app or is this just for testing?
I want to statically compile PODOFO with my application so there is no extra piecec which need to be carried with it.

Thanks

you must always ship the zlib1.dll with your program unless they provide a static-link library. You always have to put it in the same folder as your program or one of the folders listed in the PATH environment variable. The statement "during testing" is a little misleading.

If you have the source code to zlib1.dll then you can recompile it yourself to generate the static link library.

Thanks.
Do you know how to use zlib then? On their website they have the source files so I'm not sure if I have to compile it and put it in the bin folder of my IDE first. If so, where can I get instructions on how to compile zlib? Does it need to be compiled before I can use it to create a makefile with CMAKE?

On their website they have the source files so I'm not sure if I have to compile it and put it in the bin folder of my IDE first. If so, where can I get instructions on how to compile zlib?

Download the Zlib source code for Zlib version 1.2.7. Assuming that you are using a Microsoft compiler in the Win32 environment, you will then open a Visual Studio command prompt and go to the Zlib-1.2.7 folder and execute the following:

nmake.exe -f win32/Makefile.msc

This will build Zlib for you.

Thanks Bob, I'm getting warmer. Is the command prompt the same if I'm using MingW?

Download the Zlib source code for Zlib version 1.2.7. Assuming that you are using a Microsoft compiler in the Win32 environment, you will then open a Visual Studio command prompt and go to the Zlib-1.2.7 folder and execute the following:

nmake.exe -f win32/Makefile.msc

This will build Zlib for you.

Here's what I've done. I've set the Global 'Path' Variable to the 'bin' folder of MingW.
Ive placed the Zlib source code in C:\Zlib. Ive changed the directory in the command prompt screen to C:\Zlib. I have then entered this command into the command prompt: 'nmake.exe -f win32/Makefile.msc'

I get this error.> 'nmake.exe' is not recognised as an internal or external command operable program or batch file .

I don't know much about this kind of thing and have a very vuage understanding of what I'm building. Is building the same as compiling or am I turning source code into something else other than a binary. Could you suggest anything I should look at to undestand this. Thanks

nmake.exe is a Microsoft product, not supported by MinGW. If you look in the MinGW bin folder you will see mingw32-make.exe, and if you give it --help the program will display a short list of all the commands you can give it.

mingw-make.exe can not use the makefile with *.msc extension because that's for the Microsoft compiler. Look in the zlib folders and find a makefile for mingw or gnu

Edited 4 Years Ago by Ancient Dragon

I can't seem to get that exe file to run any slower that 1/10 of a second so I can't catch what it's saying.

OK, thanks.. I just had some progress, purely by accident.
I changed the directory to C:\zlib-1.2.7\ and entered the following into the command prompt.
mingw32-make -f win32\Makefile.gcc which is pretty much what you've said.

I've got more problems now. Probably related. I'm trying to install PODOFO (PDF Library) on CodeBlocks IDE (if thats the right term). Now that zlib has compiled correctly, this is what I have set in CMAKE (i'm trying to create Makefile).

Source Directory: C:\Podofo // this is where all the source files are.
Where to build the binaries: C:/CodeBlocks/MinGW/bin // this could be a really dumb move as I'm not sure where these binaries should go?

I generate the makefile (correctly MingW is selected in configuration) and I get the below error. Have I done something wrong above?

Using gcc specific compiler options
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindZLIB.cmake:47 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:309 (FIND_PACKAGE)

Where to build the binaries: C:/CodeBlocks/MinGW/bin // this could be a really dumb move as I'm not sure where these binaries should go?

You should not do that, definitely not. Usually, when working with cmake, you want to create at least three folders: src, build and bin, for the source code, the temporary build files (cmake and make cache files), and for the resulting binaries, respectively. For example, if your project is called "MyProject" and is directly in C:\MyProject folder, then you should create three folders, C:\MyProject\src (the top level folder containing all the sources), C:\MyProject\build (or C:\MyProject\src\build) (which is where you execute the cmake and make commands), and C:\MyProject\bin (where the binaries will go). When building libraries too, it is often good to output them into another directory too, e.g., C:\MyProject\lib.

So, the directory you should specify in your CMakeLists.txt for the output should be those I gave about, or something similar. The point is to keep the source file folder clean of any binary files or temporary files resulting from the build (this is called an "out-of-source build"), and put all the resulting in one separate folder. This makes for a much cleaner environment, and is especially important if you eventually decide to use a version control system.

I generate the makefile (correctly MingW is selected in configuration) and I get the below error. Have I done something wrong above?

The error reports that the find_package command in cmake was unable to locate the zlib package (e.g., library). Without seeing your cmake configuration file, it is hard to know why. You might want to check the more advanced techniques in this wiki about finding libraries with cmake. The alternative (if you just want it to work, but not portably) is to just enter the paths manually for both the include directory (where to find zlib headers) and the full-paths to the libraries (to the zlib libraries, .a or .dll files created by your build of zlib).

CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindZLIB.cmake:47 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:309 (FIND_PACKAGE)

The CMake ZLIB_LIBRARY and ZLIB_INCLUDE_DIR variables are not defined. You can define them by using the advanced option of the CMake GUI screen or at the command line as follows:

cmake -DZLIB_LIBRARY:FILEPATH="C:/utils/zlib-1.2.5/zdll.lib" -DZLIB_INCLUDE_DIR:PATH="c:/utils/zlib-1.2.5" cMakelists.txt

Ancient Dragon.. thanks for the Tutorial suggestion, but unfortunately it really doesn't help at all. It explains how to build the CMakeLists file which is already built in this case (for PODOFO). My issue comes after that stage.

This article has been dead for over six months. Start a new discussion instead.