2006.06.26 11:20 "[Tiff] linker error in opening a TIFF files", by malathi p

2006.06.27 18:35 "RE: [Tiff] linker error", by

> -----Original Message-----

> From: tiff-bounces@lists.maptools.org

> [mailto:tiff-bounces@lists.maptools.org]On Behalf Of malathi p

hi,
     i downloaded gnuwin32 and starts working with tiff in vc++6.0,but its giving an error at runtime,plz somebody help me out...

iam posting my code and the run time errors too

this s very simple appln,but nt yet working,plz help me out...

  #include<tiffio.h>
#include<iostream.h>
void main()
{
 TIFF *t=TIFFOpen("C:\3.tif","r");
 TIFFClose(t);
}

  in vc++

   --------------------Configuration: prj - Win32 Debug--------------------
Linking...
open.obj: error LNK2001: unresolved external symbol _TIFFClose

: error LNK2001: unresolved external symbol _TIFFOpen

Debug/prj.exe: fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
  prj.exe - 3 error(s), 0 warning(s)

Firstly, it's important to note that you have NOT in fact got runtime errors, as you haven't made it far enough to actually run the program. ;-) You do have a build error, however, and it's easily solved (probably).

My guess is that you have built libtiff, but you haven't actually linked its libraries to your application. To do this, edit your project settings/properties, and find a setting (probably under "linking" or something similar) that allows you specify external/3rd-party libraries to link to your app. You should add the libtiff stub, named by default, libtiff_i.lib. Don't forget to move/copy libtiff.dll to the same place where your executable (prj.exe) will end up.

Alternately, you can just link libtiff.lib (a static version of the library) to your app, and then you don't need to mess about with the DLL.