AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1999.03.11 13:40 "problems with libtiff", by Chris Friesen
1999.03.11 13:46 "Re: problems with libtiff", by John McClurkin

1999.03.11 13:40 "problems with libtiff", by Chris Friesen

I'm just starting to do some coding with this, and so I'm wondering if someone could help me.

I used the TIFF .h, .lib and .dll files from ImageMagick (could someone PLEASE tell me exactly HOW to compile libtiff on its own using MSVC++ 6?) and copied this example program from the web pages:

#include <stdio.h>
#include "tiffio.h"
 
int main(int argc, char* argv[])
     {
         TIFF* tif = TIFFOpen(argv[1], "r");
         if (tif) {
             uint32 w, h;
             size_t npixels;
             uint32* raster;

             TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
             TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
             npixels = w * h;
             raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));
             if (raster != NULL) {
                 if (TIFFReadRGBAImage(tif, w, h, raster, 0)) {

                   printf("successfully read the image!");

                 }
                 _TIFFfree(raster);
             }
             TIFFClose(tif);
         }
         exit(0);
}

However, it is giving me the following error message:

--------------------Configuration: Testlib - Win32
Debug--------------------
Linking...
Mainfile.obj: error LNK2001: unresolved external symbol __TIFFfree
Mainfile.obj: error LNK2001: unresolved external symbol __TIFFmalloc
Debug/Testlib.exe: fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

Testlib.exe - 3 error(s), 0 warning(s)

What it looks like is that the linker is trying to find functions with TWO underscores in front of it rather than just one. Doesn anyone know how I can fix this?

Thanks,

Chris


Editor's note: This mail was not originally archived, and has been reconstructed from quotes.