AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1999.11.22 18:00 "How to work with libtiff on WinNT/VC++6", by
1999.11.22 18:40 "Re: How to work with libtiff on WinNT/VC++6", by Frank Warmerdam
1999.11.25 07:18 "Problem with libtiff CCITT Fax 4 Decoder", by Kristian Sandven
1999.11.25 07:40 "Problem with libtiff CCITT Fax 4 Decoder", by Kristian Sandven

1999.11.22 18:40 "Re: How to work with libtiff on WinNT/VC++6", by Frank Warmerdam

my name is Ruediger and I am in this mailinglist for just a few weeks. I have just begun using libtiff, and I need some help for getting started quick. I hope somebody can tell me how to use/compile programms using libtiff v3.4 on a WinNT 4.0 SP4 Workstation with MS Visual C++ 6.0, or tell me a link to a good guide on how using libtiff.

e.g. what will I have to do to compile this program?

Do I have to precompile the libtiff?

Do I have to set some path to libtiff?

If I just try to compile this program, I can compile, but then I get a link error (unresolved external symbol), and I don't know which library to use.

#include <stdlib.h>
#include "tiffio.h"

void main(int argc, char* argv[])
{
    TIFF* tif = TIFFOpen(argv[1], "r");
    if (tif) {
     int dircount = 1;
     do {
         dircount++;
     } while (TIFFReadDirectory(tif));
     printf("%d directories in %s\n", dircount, argv[1]);
     TIFFClose(tif);
    }
    exit(0);
}

Thank you very much for your help,
I look forward hearing from you,
with best regards,

Ruediger,

I would suggest you fetch the latest libtiff distribution off www.libtiff.org, which is 3.5.2. This includes simple makefiles for Windows and MS VC++.

To build libtiff.lib, and libtiff.dll type the following in libtiff\libtiff:

  makefile /f makefile.vc all

To build the example programs type the following in libtiff\tools:

  makefile /f makefile.vc

My default the libtiff/libtiff/makefile.vc file is building in console mode, that is libtiff errors are redirected to stderr. If you want them to appear in popup windows, recompile with WINMODE set to -DTIF_PLATFORM_WINDOWED in the makefile (near top).

Let me know if you have problems with this process. I do hope to fix up the build documentation for windows in an upcoming release, but for now I would appreciate feedback on the mechanism.

Once the above is complete you would compile you program ensuring that the "-IC:\libtiff\libtiff" or something similar is specified to find the include files, and that you link against C:\libtiff\libtiff\libtiff.lib.

If you wish to use the DLL, link against the libtiff_i.lib stub library.

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turned up | Frank Warmerdam, warmerda@home.com
light and sound - activate the windows | http://members.home.com/warmerda
and watch the world go round - Rush    | Geospatial Programmer for Rent