Third-party library compilation notes

  1. Download the latest zlib-1.2.8 source code from http://www.zlib.net/ , create a new zlib static library project, add the .h and .c files in the /zlib-1.2.8 directory to this project, and compile Generate zlib static library;

  2. Download the latest libpng-1.6.19 from http://www.libpng.org/pub/png/libpng.html , create a new libpng static library project, and add the .h and .c files in the /lpng1619 directory to this project , copy the pnglibconf.h.prebuilt file in the /lpng1619/scripts directory to the /lpng1619 directory, and modify the file name to pnglibconf.h, add this file to this project, and put zlib.h in the pngstruct.h file Change to the correct storage path, compile and generate libpng static library;

  3. Download the latest jpeg-9a source code from http://libjpeg.sourceforge.net/ , create a new ligjpeg static library project, and add the .h and .c files in the /jpeg-9a directory to this project (jmemdos.c and jmemmac .c file), rename jconfig.vc to jconfig.h, add this file to this project, compile and generate libjpeg static library;

  4. Download the stable version of tiff-4.0.6 source code from ftp://ftp.remotesensing.org/pub/libtiff , create a new libtiff static library project, and place the corresponding .h and .c files in the /tiff-4.0.6/libtiff directory Add to this project, rename tiff_config.vc.h, tiffconf.vc.h to tiff_config.h, tiffconf.h respectively, add these two files to this project, compile and generate libtiff static library;

  5. Download the latest gitlib-5.1.1 source code from http://sourceforge.net/projects/giflib/ , create a new giflib static library project, and add the corresponding .h and .c files in the /giflib-5.1.1 directory to this project , adjust the source file, use the source file to use#include <stdbool.h>的地方,用以下语句替换,

[cpp] view plain copy
//#include <stdbool.h>  
#ifndef __cplusplus  
    typedef int bool;  
    #define false 0  
    #define true 1  
#endif  

Comment out all the places used in the file #include<unistd.h>, compile and generate the giflib static library;
the compilation of the library that Leptonica depends on above is completed.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325527388&siteId=291194637