在Visual Studio 2010中使用LibTiff [英] Using LibTiff in Visual Studio 2010

查看:307
本文介绍了在Visual Studio 2010中使用LibTiff的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Visual Studio 2010中的C ++程序中使用LibTiff。我从



我成功使用了使用这种方法构建的libtiff-3.9.4和tiff2pdf。



Btw,libtiff版本3.9.4



下面是我的 LibTiff.vcxproj 的一部分。它显示了使用Visual Studio 2010在Windows上构建libtiff所需的文件。

 < 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/>


I'm 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 a step by step instruction how to import libtiff to visual Studio and build the Fax2Tiff tool.

There are so many files so that I am totally confused.

What I already have done:

1) Created a new Empty Win32 Console Application Project named "TiffTest"

2) Copied the folder "libtiff" from the tiff-3.9.2.zip to the Project Folder

3) Copied the file "fax2tiff.c" to the Project Folder

4) Added those files to the Project

5) Added the "libtiff" folter to the additional include 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 really work. All I do to get rid of the error messages causes new error messages. Can anyone tell me how I can get libtiff to work?

I really need help...

Thank you so much!

解决方案

I think it would be better

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

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

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

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

Btw, libtiff version 3.9.4 is most recent one in 3.x branch.

Below is the part of my LibTiff.vcxproj. It shows which 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" />

这篇关于在Visual Studio 2010中使用LibTiff的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆