LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   tiff library - linker error (https://www.linuxquestions.org/questions/programming-9/tiff-library-linker-error-190658/)

nimra 06-07-2004 08:44 AM

tiff library - linker error
 
Hi everybody

I try to create a tiff. My test code is the following:

#include "tiffio.h"
main(){
TIFF* tif = TIFFOpen("mypic.tif", "w");
TIFFClose(tif);
}

then i compile with g++ tifftest.cpp and i fail:

In function 'main':
: undefined reference to 'TIFFOpen'
In function 'main':
: undefined reference to 'TIFFClose'
collect2: ld returned 1 exit status

The tiffio.h library is where it should be and both functions are declared there, as well.

somebody has an idea? thx a lot.

nimra 06-07-2004 10:58 AM

It works!

I solved it with:
g++ -o tifftest tifftest -lm ltiff

Does anybody know why the #include is not sufficient?

nimra 06-08-2004 02:22 AM

Sorry, there are some errors in the comand

g++ -o tifftest tifftest.cpp -lm -ltiff

Hope that it will help somebody:p

romagnolo 10-08-2011 03:54 AM

Quote:

Originally Posted by nimra (Post 978969)
Sorry, there are some errors in the comand

g++ -o tifftest tifftest.cpp -lm -ltiff

Hope that it will help somebody:p

It did now! ;)


All times are GMT -5. The time now is 10:05 PM.