2012.02.01 20:06 "Re: [Tiff] linking libtiff in ubuntu", by Jay Berkenbilt
[sorry if this is a duplicate...I think I accidentally bcc'ed the list last time...]
Correct. Also, be sure you are linking with -ltiff, not -llibtiff. If you wanted to know which tiff-related packages you had installed, you could run
dpkg --list '*tiff*'
since all the tiff library packages contain the word tiff in them. This isn't necessarily 100% reliable in the general case, but it would work here.
On 02/01/2012 01:49 PM, christopher.schmidt@nokia.com wrote:
Note that apt-cache search is searching the packages you *could* install, not the packages that *are* installed. dpkg is the tool that shows what you have. In this case, it seems like perhaps you need to 'apt-get install libtiff4-dev' to get the development libraries on your system...
-- Chris
On Feb 1, 2012, at 1:23 PM, ext Frank Warmerdam wrote:
> 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
> libtiff4 - Tag Image File Format (TIFF) library> 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,