Using LibTiff in Visual Studio 2010

I am trying to use LibTiff in a C ++ program in Visual Studio 2010. I downloaded tiff-3.9.2.zip from ftp://ftp.remotesensing.org/pub/libtiff . To test LibTiff, it would be nice if someone could give me step-by-step instructions on how to import libtiff into visual Studio and create the Fax2Tiff tool.

There are so many files that I am completely confused.

What I have already done:

1) Created a new empty Win32 Console application project called "TiffTest"

2) Copy the "libtiff" folder from the tiff-3.9.2.zip file to the project folder

3) Copy the file "fax2tiff.c" to the project folder

4) Added these files to the project

alt textalt text

5) Added "libtiff" list for additional included folders

6) Renamed the files "tif_config.vc.h" and "tiffconf.vc.h" to "tif_config.h" and "tiffconf.h"

7) Tried to compile it.

This does not work. Everything that I do to get rid of error messages causes new error messages to appear. Can someone tell me how can I get libtiff to work?

I really need help ...

Thank you very much!

+4
source share
1 answer

I think it would be better

  • to build libtiff as a static library.
  • to build fax2tiff as a console application that communicates with the library

In addition, you must decide which version of the files and memory-related files you want to use in your version of the library. There are Unix, DOS, and Windows versions for files associated with files and memory.

And for fax2tiff, you probably need the Windows version of getopt.c and getopt.h . You can use wingetopt.h and wingetopt.c found on koders.com

I successfully use libtiff-3.9.4 and tiff2pdf created using this approach.

Btw, libtiff version 3.9.4 is the latest in branch 3.x.

The following is part of my LibTiff.vcxproj . It shows what files are needed to build libtiff on Windows using Visual Studio 2010.

 <ItemGroup> <ClInclude Include="t4.h" /> <ClInclude Include="tiff.h" /> <ClInclude Include="tiffconf.h" /> <ClInclude Include="tiffio.h" /> <ClInclude Include="tiffiop.h" /> <ClInclude Include="tiffvers.h" /> <ClInclude Include="tif_config.h" /> <ClInclude Include="tif_dir.h" /> <ClInclude Include="tif_fax3.h" /> <ClInclude Include="tif_predict.h" /> <ClInclude Include="uvcode.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="tif_aux.c" /> <ClCompile Include="tif_close.c" /> <ClCompile Include="tif_codec.c" /> <ClCompile Include="tif_color.c" /> <ClCompile Include="tif_compress.c" /> <ClCompile Include="tif_dir.c" /> <ClCompile Include="tif_dirinfo.c" /> <ClCompile Include="tif_dirread.c" /> <ClCompile Include="tif_dirwrite.c" /> <ClCompile Include="tif_dumpmode.c" /> <ClCompile Include="tif_error.c" /> <ClCompile Include="tif_extension.c" /> <ClCompile Include="tif_fax3.c" /> <ClCompile Include="tif_fax3sm.c" /> <ClCompile Include="tif_flush.c" /> <ClCompile Include="tif_getimage.c" /> <ClCompile Include="tif_jbig.c" /> <ClCompile Include="tif_jpeg.c" /> <ClCompile Include="tif_luv.c" /> <ClCompile Include="tif_lzw.c" /> <ClCompile Include="tif_next.c" /> <ClCompile Include="tif_ojpeg.c" /> <ClCompile Include="tif_open.c" /> <ClCompile Include="tif_packbits.c" /> <ClCompile Include="tif_pixarlog.c" /> <ClCompile Include="tif_predict.c" /> <ClCompile Include="tif_print.c" /> <ClCompile Include="tif_read.c" /> <ClCompile Include="tif_strip.c" /> <ClCompile Include="tif_swab.c" /> <ClCompile Include="tif_thunder.c" /> <ClCompile Include="tif_tile.c" /> <ClCompile Include="tif_unix.c" /> <ClCompile Include="tif_version.c" /> <ClCompile Include="tif_warning.c" /> <ClCompile Include="tif_write.c" /> <ClCompile Include="tif_zip.c" /> 
+3
source

Source: https://habr.com/ru/post/1334935/


All Articles