2012.02.01 21:48 "[Tiff] tiff warning question", by

2012.02.01 18:23 "Re: [Tiff] linking libtiff in ubuntu", by Frank Warmerdam

On Wed, Feb 1, 2012 at 9:41 AM, Martin Alegre <tin.alegre@gmail.com> wrote:

> Dear all,
>

> I'm wondering, which is the correct way to link the libtiff library in > ubuntu? I'm using g++ 4.6.0 on Ubuntu 11.04 and running the command below to

> build the executable:
> g++ -ggdb -ansi -std=c++0x -llibtiff ./src/color.cpp  -I./inc -o
> ./obj/color.o
>

Martin,

On my system I see:

warmerdam@gdal:~$ apt-cache search libtiff

pngtools - series of tools for PNG (Portable Network Graphics) images

libtiff-doc - TIFF manipulation and conversion documentation

libtiff-tools - TIFF manipulation and conversion tools
Tag Image File Format (TIFF) library libtiff4 -

libtiff4-dev - Tag Image File Format library (TIFF), development files

libtiffxx0c2 - Tag Image File Format (TIFF) library -- C++ interface

libtiff-opengl - TIFF manipulation and conversion tools

warmerdam@gdal:~$ ls -l /usr/include/tiffio.h -rw-r--r-- 1 root root 20428 2011-04-20 10:42 /usr/include/tiffio.h

warmerdam@gdal:~$ cat test1.c

        #include <tiffio.h>

int main(int argc, char **argv)

{
        TIFF *h = TIFFOpen("utm.tif","r");
}
warmerdam@gdal:~$ g++ test1.c -o test1 -ltiff

So you shouldn't need to do anything special. Of course you are running into problems but I'm not sure why. Do check if tiffio.h is in /usr/include, /usr/include/libtiff or somewhere similar.

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    | Geospatial Software Developer