Build differently named 32 and 64 bit binaries for libharu that link to differently named zlib binaries
- zlib binaries: tested with zlib 1.2.8
- libpng static libraries: tested with libpng 1.2.53
- msvc: tested with MSVS 2019 Community Edition
- libpng vs2019 solution: tested with these sources.
- Save these files to C:\local\libharu and open libharu.sln
- Place zlib in C:\local\libs\zlib such that zlib64.lib and zlib32.lib are in C:\local\libs\zlib\lib
- Place libpng in C:\local\libs\libpng such that libpng64.lib and libpng32.lib are in C:\local\libs\libpng\lib
- Select Build -> Batch and select all four configurations (Release|Debug)<-->(x64|Win32) and build
- Place the files into C:\local\libs\libharu
- \include all 64 .h files
- \bin Release: libharu32.dll, libharu64.dll Debug: libharu32d.dll, libharu64d.dll
- \lib Release: libharu32.lib, libharu64.lib Debug: libharu32d.lib, libharu64d.lib
- Place the files into C:\local\libs\libharu
- Extract libharu-RELEASE_2_3_0.zip
- Create a Visual Studio Solution ... Win32 ... DLL ... empty project ... and name it libharu
- Copy the following files into the project directory:
- .c files in /src (and t4.h)
- all .h files in /include and the .h file in /win32/include
- The file "libhpdf.rc.template" under /win32. Rename it to libhpdf.rc
- Import all the files in 3 into the project
- Edit the files as follows:
- hpdf_version.h remove all occurences of RC2
- hpdf_config.h replace all occurences of 2.2.0 with 2.3.0
- hpdf_image_png.c initialize row to NULL in line 244 (png_bytep *row_ptr, row;)
- libhpdf.rc replace all occurences of _VERSION2 with 2.3.0
- replace all occurrences of _VERSION1 with 2,3,0
- edit "Haru Free PDF Library [_COMPILER]" to just "Haru Free PDF Library"
- Under project properties do the following:
- Configuration Properties -> General -> Target Name
- x64 Release $(ProjectName)64
- x64 Debug $(ProjectName)64d
- Win32 Release $(ProjectName)32
- Win32 Debug $(ProjectName)32d
- C/C++ -> Precompiled Headers -> Precompiled Header
- ALL Not Using Precompiled Headers
- C/C++ -> Preprocessor -> Preprocessor Definitions
- ALL Add HPDF_DLL_MAKE_CDECL
- C/C++ -> General -> Additional Include Directories
- ALL C:\local\libs\zlib\include
- C:\local\libs\libpng\include
- Linker -> General -> Additional Library Directories
- ALL C:\local\libs\zlib\lib
- C:\local\libs\libpng\lib
- Linker -> General -> Additional Dependencies
- x64 both zlib64.lib, libpng64.lib
- Win32 both zlib32.lib, libpng32.lib
- Configuration Properties -> General -> Target Name
- All four configurations ready to be built as this ready-made solution.