【问题标题】:Using LibTiff in Visual Studio 2010在 Visual Studio 2010 中使用 LibTiff
【发布时间】:2011-01-10 14:27:05
【问题描述】:

我正在尝试在 Visual Studio 2010 的 C++ 程序中使用 LibTiff。我从 ftp://ftp.remotesensing.org/pub/libtiff 下载了 tiff-3.9.2.zip。要测试 LibTiff,如果有人可以逐步指导我如何将 libtiff 导入到 Visual Studio 并构建 Fax2Tiff 工具,那就太好了。

文件太多,我完全糊涂了。

我已经做了什么:

1) 创建了一个名为“TiffTest”的新的 Empty Win32 控制台应用程序项目

2) 将文件夹“libtiff”从 tiff-3.9.2.zip 复制到项目文件夹

3) 将文件“fax2tiff.c”复制到项目文件夹

4) 将这些文件添加到项目中

5) 将“libtiff”文件夹添加到附加的包含文件夹中

6) 将文件“tif_config.vc.h”和“tiffconf.vc.h”重命名为“tif_config.h”和“tiffconf.h”

7) 尝试编译它。

这实际上不起作用。我为摆脱错误消息所做的一切都会导致新的错误消息。谁能告诉我如何让 libtiff 工作?

我真的需要帮助......

非常感谢!

【问题讨论】:

  • 您最好下载二进制文件?您是否尝试过此链接 - 也有一些安装说明:gnuwin32.sourceforge.net/packages/tiff.htm
  • 下次对错误列表进行截图。
  • 如果您只需要 libtiff 的基础知识,您可以使用来自 nuget 的包!这使开始更容易。

标签: c++ visual-studio-2010 libtiff


【解决方案1】:

我觉得会更好

  • 将 libtiff 构建为静态库。
  • 将fax2tiff 构建为与库链接的控制台应用程序

此外,您应该决定要在您的库版本中使用哪个版本的文件和内存相关文件。文件和内存相关文件有 Unix、DOS 和 Windows 风格的版本。

对于fax2tiff,您可能需要Windows 版本的getopt.cgetopt.h 文件。您可以使用wingetopt.hwingetopt.c found on koders.com

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

顺便说一句,libtiff 版本 3.9.4 是 3.x 分支中的最新版本。

下面是我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" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多