在 Visual Studio 2010 中使用 LibTiff

发布于 2024-10-11 09:28:26 字数 815 浏览 6 评论 0原文

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

文件太多,让我完全困惑。

我已经做了什么:

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

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

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

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

alt textalt text

5) 将“libtiff”文件夹添加到其他包含文件夹

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

7)尝试编译它。

这确实行不通。我为消除错误消息所做的一切都会导致新的错误消息。谁能告诉我如何让 libtiff 工作?

我真的需要帮助...

非常感谢!

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

alt textalt text

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

上课铃就是安魂曲 2024-10-18 09:28:26

会更好

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

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

对于fax2tiff,您可能需要Windows 版本的getopt.cgetopt.h 文件。您可以使用 wingetopt.hwingetopt.c 在 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" />

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" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文