libhura establishment

libharu export pdf is an open source library at compile libharu need to use the zlib library and libpng library (libpng depends on zlib library).
If you do not need to export pdf with pictures project can involve "png.h" file delete itself.

Turn lemianli (this method is relatively simple, while compiling libpng and zlib library)
compiled libpng library and libz:
1. First download libpng (http://sourceforge.net/projects/libpng/files/) and libz (http: / /zlib.net/zlib-1.2.7.tar.gz), the libpng decompression, such as C: \ workspace \ libpng \.
2. libz decompression, renamed libpng zlib into the same directory, such as C: \ workspace \ zlib.
3. Go to libpng \ projects \ visualc71 \, open the project file with visual studio, there will be three sub-projects program: libpng, pngtest, zlib. Directly translated, and nothing else will be under Win32_DLL_Debug \ ZLib catalog generation zlib1d.dll, libpng15d.dll, libpng.lib and zlib.lib and other libraries in the Win32_DLL_Debug directory.
4. If error, copy scripts / pnglibconf.h.prebuilt to the source directory, renamed pnglibconf.h

revolutions http://www.cnblogs.com/sanghg/p/5487509.html (the process more complex compiler)
# compiling method a #
- extract the source files to a specified directory, for example, x: \ zlib
- Open the VS2015 Developer Command Prompt for VS2015 Tools
- Switch to x: \ zlib \ contrib \ masmx86 directory, if you want to compile x64, you can enter masmx64 directory, I use here only 32
- execution bld_ml32.bat file, waiting for the moment 4 generates files in the directory
- file copy inffas32.obj generated file to the root and match686.obj x: \ at zlib
- Developer Command Prompt for VS2015 the tool change directory to the root directory x: \ zlib
- nmake command execution
`` `
nmake -f win32 / Makefile.msc LOC =" - DASMV -DASMINF "ObjA =" inffas32.obj match686.obj "  
` ``
- after successfully compiled, will produce a series of files in the root directory, zdll.lib and zlib1.dll which is the file we need
# # compiler method two
- extract the source files to a specified directory, such as the X-: \ zlib
- open VS2015's Developer Command Prompt for VS2015 tools
- switch to x: \ zlib \ contrib \ masmx86 directory, if you want to compile x64, you can enter masmx64 directory, only 32 I have here
- the implementation bld_ml32.bat file, waiting for the moment will have four files in the directory
- generated file inffas32. Copy and match686.obj obj file to the root directory x: \ zlib under
- Copy x: \ zlib \ contrib \ vstudio \ v11 to the X-: \ zlib \ contrib \ vstudio \ V14
- with the Visual Studio 2015 IDE to open the x: \ zlib \ contrib \ vstudio \ v14 \ zlibvc.sln and compile
the compilation process may there will be the following questions
1.error LNK2026: module unsafe for SAFESEH image
modification attribute / linker / Advenced / Image has safe Exception Handles for the No
2.fatal error LNK1118: syntax error in 'VERSION' of Statement
VERSION modify the file open zlibvc.def 1.28 to
 

The creation of the project

  •  In libpng and zlib directories are created include folders and folders lib ask price
  • include .h and .c file is stored in the same directory
  • lib is used to store into a static library (.lib)

For the project to use these two libraries, the main need to do three things:
1. C / C ++ General -> Additional Include directory to the directory containing the header file png.h add to the mix, etc.
2. Linker -> Input - > additional dependencies added zlib.lib; libpng.lib.
3. General Properties -> VC ++ directory -> library directory to the directory libpng.lib stood zlib.lib and add to the mix.

# Summary #
1, a new item to select the output dll, empty item
2, the libharu unpack the src and include files added to the project
3, adding libpng and zlib libraries
1> C / C ++ General -> Additional Include directory to include png .h file directory, etc. add to the mix head
2> linker -> input -> additional dependencies added zlib.lib; libpng.lib.
3> common attributes -.> VC ++ directory -> library directory to the directory libpng.lib stood zlib.lib and add to the mix.
4, compiled in ~~~~ \ Visual Studio 2008 \ Projects \ {project_name} \ Debug \ lib lookup file and generate dll
5, demo achieve various effects have source code, self-test

Guess you like

Origin www.cnblogs.com/wlstm/p/10992558.html