AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
April 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.04.25 16:52 "linker problem", by Vinay Ramdas
2008.04.25 17:48 "Re: linker problem", by Frank Warmerdam
2008.04.25 21:16 "Re: linker problem", by Vinay Ramdas

2008.04.25 17:48 "Re: linker problem", by Frank Warmerdam

Vinay Ramdas wrote:
> Hi,
> 
> I am trying to build a dll using libtiff. My sources file has the 
> following entry
> 
> TARGETLIBS=  $(TARGETLIBS)              \
>                 $(SDK_LIB_PATH)\libtiff_i.lib    \
> 
> When i try to build i get the following errors
> 
> error LNK2019: unresolved external symbol __TIFFfree@4 referenced in 
> function _save_to_tif@4
> error LNK2019: unresolved external symbol _TIFFWriteScanline@16 
> referenced in function _save_to_tif@4
> error LNK2019: unresolved external symbol _TIFFDefaultStripSize@8 
> referenced in function _save_to_tif@4
> error LNK2019: unresolved external symbol __TIFFmalloc@4 referenced in 
> function _save_to_tif@4
> error LNK2019: unresolved external symbol _TIFFScanlineSize@4 referenced 
> in function _save_to_tif@4
> error LNK2019: unresolved external symbol _TIFFOpen@8 referenced in 
> function _save_to_tif@4
> 
> dumpbin.exe /exports C:\libtiff_i.lib gives me ( I am pasting only 
> output related to the above functions )
> 
>  _TIFFSetField
>  _TIFFOpen
>  _TIFFDefaultStripSize
>  _TIFFScanlineSize
> _TIFFWriteScanline
>  __TIFFFree
>  __TIFFmalloc
> 
> 
> Interestingly, I have also used the function TIFFSetField in the 
> function save_to_tif and that does not come up in the linker error. 
> Any ideas what the problem could be ? Please help.

Vinay,

Is there any change you compiled your project to use stdcall instead
of cdecl calling conventions?  The @4, @16 etc decorations in the
unresolved symbols indicates the linker was looking for stdcall
style functions while libtiff is normally compiled with the default
cdecl calling convention which does not include the extra decorations.

It looks like /Gz is the VC++ switch that turns on stdcall conventions.
You want to either avoid it in your project, or rebuild libtiff to
include it.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org