I'm trying to follow the ALP tutorial (
http://www.makelinux.net/alp/). I have just installed Ubuntu 9.04 so the system is pretty much a clean system.
I am trying to compile this code:
Code:
#include <stdio.h>
#include <tiffio.h>
int main (int argc, char** argv)
{
TIFF* tiff;
tiff = TIFFOpen (argv[1], "r");
TIFFClose (tiff);
return 0;
}
Code:
gcc tifftest.c -o tifftest -ltiff
The first problem I get is
Code:
tifftest.c:8:20: error: tiffio.h: No such file or directory
And when I look in /usr/include there is no file tiffio.h. So as a kludge I download the source for libtiff (
http://www.libtiff.org/) and I copy the header files to the current directory (change the code appropriately) and try again. Now the code compiles but won't produce the object file:
Code:
/usr/bin/ld: cannot find -ltiff
collect2: ld returned 1 exit status
/uisr/lib has libtiff.so.4 and libtiff.so.4.2.1 so I am at a bit of a loss as to why ld is not finding libtiff.
Does anyone have some suggestions of what I should do now?
1) what do I need to do to install the libtiff header files properly?
2) how do I get gcc to find libtiff?
I am sure these are noob questions, but I haven't need able to find any answers in the searches I have done.
Richard