0

I am trying to use the LibTIFF library in a C++ Visual Studio 2019 project, so far without success. Building the library is no problem and leaves me with both a "tiff.lib" and a "tiff.dll".

Since i only need them for this project, i haven't done any linking or added them to PATH - the files and their folder are however referenced in the Visual Studio config under "Linker/Additional Dependencies" and "Linker/Additional Libraries" respectively.

The declarations i need should be available by using #include <tiffio.h> or #include "tiffio.h", which currently only give me the error "File Source Cannot be Opened"

How do i add the functionality of this library to my Project?

The following questions are related but only cover the build process: Using LibTiff in Visual Studio 2010 Installing LibTiff to Visual Studio 2010

Ismir Egal
  • 152
  • 8
  • You need to add the path to those header files to Additional Include Directories under C++/General for the project. – Retired Ninja Jun 21 '22 at 00:53
  • 2
    I just used vcpkg to add in libtiff. Works well in various projects vs2019 and vs2022 – doug Jun 21 '22 at 00:55
  • Well, that was almost disappointingly easy. Installing vcpkg and adding the library worked. Thanks! Edit: do you want to post this as an answer so i can close this question? – Ismir Egal Jun 21 '22 at 01:18

1 Answers1

2

Installing vcpkg and then using vcpkg install tiff installs the LibTIFF library and allows you(me) to import the TIFF functions to any c/c++ project. This also skips the need for building the library.

Thanks at @doug for this solution

Ismir Egal
  • 152
  • 8
  • You're welcome Ismir. Just saw your response. Go ahead and mark it as the answer. While neither of us gets credit it still helps people looking for answers. – doug Jun 22 '22 at 23:01
  • Consider clicking '✔' to mark it as the accepted answer. It will also help others to solve the similar issue. – Minxin Yu - MSFT Jun 24 '22 at 01:57