Browse Source

Made changes to makefile to compile libPDF. Created all .o files from
libtiff, libpng, libjpeg, freetype2, aesgm, zlib and compiled them into
PDFWriter.lib. Was able to use PDFWriter.lib to compile PDFHummusTest1.exe.

wes 4 years ago
parent
commit
bbd095138a

+ 1 - 1
Makefile

@@ -32,4 +32,4 @@ libharuEXMP.exe : libharuEXMP.cpp libharuEXMP/libpng16.dll libharuEXMP/libhpdf.d
 cleanPDFtest.exe : cleanPDFtest.cpp cleanPDFtest/libpng16.dll cleanPDFtest/libhpdf.dll
 	g++ $< -L $(ow)/lib/  -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
 pdfHummusTest1.exe : pdfHummusTest1.cpp
-	g++ $< -I "C:\Program Files (x86)\PDFHUMMUS\include" -L "C:\Program Files (x86)\PDFHUMMUS\lib" -lPDFWriter -o $(basename $@)/$@
+	g++ -I C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/include $< -L C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/objs -lall -o $(basename $@)/$@

+ 10 - 7
PDFHummus-minGW-tools/Makefile

@@ -1,10 +1,13 @@
 #  was receiving these errors ["C:\Program: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)] when g++ -I parameter, had a double quoted string
 
-# get a list of all cpp files in the PDFHummus/PDFWriter directory
+#  get a list of all cpp files in the PDFHummus/PDFWriter directory
 files := $(wildcard *.cpp)
 all : $(files:.cpp=.o)
+	'$(ProgramFiles)/Git/usr/bin/rm.exe' -rf objs
+	mkdir objs
+	cp \*.o objs/
 
-# ft2build.h
+#  ft2build.h
 ANSIFontWriter.o \
 AbstractContentContext.o \
 CFFANSIFontWriter.o \
@@ -24,25 +27,25 @@ Type1ToCFFEmbeddedFontWriter.o \
 UsedFontsRepository.o :
 	g++ -c $(@:.o=.cpp) -I 'C:/Users/bad-p/Downloads/freetype2/include'
 
-# aescpp.h
+#  aescpp.h
 DecryptionHelper.o \
 EncryptionHelper.o : 
 	g++ -c $(@:.o=.cpp) -I '../LibAesgm'
 
-# zlib.h
+#  zlib.h
 InputFlateDecodeStream.o \
 OutputFlateDecodeStream.o \
 OutputFlateEncodeStream.o : 
 	g++ -c $(@:.o=.cpp) -I '../Zlib'
 
-# jpeglib.h
+#  jpeglib.h
 PDFParser.o :
 	g++ -c $(@:.o=.cpp) -I '../LibJpeg'
 
-# png.h
+#  png.h
 PNGImageHandler.o :
 	g++ -c $(@:.o=.cpp) -I '../LibPng'
 
-# tiffconf.h
+#  tiffconf.h
 TIFFImageHandler.o : 
 	g++ -c $(@:.o=.cpp) -I '../LibTiff'

+ 18 - 1
PDFHummus-minGW-tools/README.txt

@@ -14,4 +14,21 @@
    // fpermissive is needed because the author chose to implicitly switch between pointers of uint_8 and char.
    g++ -c -fpermissive *.o
    ar -cvq aesgm.lib *.o
-   g++ -I "C:\Users\bad-p\Downloads\PDFHummus-build\PDFHummus\LibAesgm"
+   g++ -I "C:\Users\bad-p\Downloads\PDFHummus-build\PDFHummus\LibAesgm"
+5. 
+   Download libtiff from: https://gitlab.com/libtiff/libtiff 
+   After compiling the libtiff library with the Cmake file, all object files are located in C:\Users\bad-p\Downloads\TRASH\libtiff-master\build\libtiff\CMakeFiles\tiff.dir
+
+   Download libpng from: https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.xz/download?use_mirror=newcontinuum
+   After compiling the libpng library with the Cmake file, all object files are located in C:\Users\bad-p\Downloads\TRASH\libpng-1.6.37\build\CMakeFiles\png_static.dir
+  
+   Download libjpeg from:https://sourceforge.net/projects/libjpeg/files/
+   After compiling the libjpeg library with the Cmake file, all object files are located in C:\Users\bad-p\Downloads\TRASH\jpeg-6b
+   
+   Download zlib from: https://www.zlib.net/
+   After compiling the zlib library with the Cmake file, all object files are located in C:\Users\bad-p\Downloads\TRASH\zlib-1.2.11
+
+   For all CMake instructions create a build directory in the source root. CD in to build, run Cmake .. for windows using msys pass the 'Cmake .. -G "MSYS Makefiles"' 
+   build option to generate a makefile appropiate for msys; You can use make afterwards to compile as normal.
+   After all of the object files are moved into the same folder, generate a library for PDFWriter.
+   ar -cvq PDFWriter.lib *.o 

+ 7 - 0
PDFHummus-minGW-tools/notes.txt

@@ -18,3 +18,10 @@ we put together a strategy on where to put the unsupported (vcpkg) libraries tha
 Next time, we will use the previous created makefile as well as these libraries to compile PDFHummus.
 We dumped all of the steps to get to this point into a file so we can clean up these build instructions:
 README.txt
+
+12 April 2020
+Today we compiled all of the object files for libtiff, libpng, libjpeg, libaesgm, zlib, and freetype2. After compiling all of the object files we archived them into a lib file.
+All h files for each of the libraries were copied into our main library (include folder) for usage in PDFWriter.lib.
+Initially there were some issues with the Aesgm library where the object files did not compile correctly and were giving us some errors. However, after recompiling them and 
+making some KYLE modificiations, they ended up working well and were ok being incorporated into the PDFWriter.lib. 
+Now that we have our PDFWriter.lib finally compiled we can start to use PDFHummus and we should also find out if the Aesgm problem can be recreated.

+ 1 - 0
PDFWriter.lib

@@ -0,0 +1 @@
+!<arch>

+ 0 - 0
move.cpp


+ 1 - 1
pdfHummusTest1.cpp

@@ -5,7 +5,7 @@
 
 #include <stdlib.h>
 #include <iostream>
-#include "PDFWriter/PDFWriter.h"
+#include "PDFWriter.h"
 
 int main(){
     PDFWriter pdfWriter;

BIN
pdfHummusTest1/pdfHummusTest1.exe


BIN
snippets/move-multiple.ps