"Unresolved external symbols" Using libtiff library in OpenGL using Qt and MS Visual Studio/ C++.

chubbycuban
chubbycuban used Ask the Experts™
on
In building my project I get the errors below.

I've never used the Libtiff library before. Please help!
glwidget.obj : error LNK2019: unresolved external symbol _TIFFRGBAImageEnd referenced in function "public: int __thiscall GLWidget::readTiffImage(char *,unsigned int *)" (?readTiffImage@GLWidget@@QAEHPADPAI@Z)
1>glwidget.obj : error LNK2019: unresolved external symbol _TIFFError referenced in function "public: int __thiscall GLWidget::readTiffImage(char *,unsigned int *)" (?readTiffImage@GLWidget@@QAEHPADPAI@Z)
1>glwidget.obj : error LNK2019: unresolved external symbol _TIFFRGBAImageGet referenced in function "public: int __thiscall GLWidget::readTiffImage(char *,unsigned int *)" (?readTiffImage@GLWidget@@QAEHPADPAI@Z)
1>glwidget.obj : error LNK2019: unresolved external symbol __TIFFmalloc referenced in function "public: int __thiscall GLWidget::readTiffImage(char *,unsigned int *)" (?readTiffImage@GLWidget@@QAEHPADPAI@Z)
1>glwidget.obj : error LNK2019: unresolved external symbol _TIFFRGBAImageBegin referenced in function "public: int __thiscall GLWidget::readTiffImage(char *,unsigned int *)" (?readTiffImage@GLWidget@@QAEHPADPAI@Z)
1>glwidget.obj : error LNK2019: unresolved external symbol _TIFFOpen referenced in function "public: int __thiscall GLWidget::readTiffImage(char *,unsigned int *)" (?readTiffImage@GLWidget@@QAEHPADPAI@Z)

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
jkr
Top Expert 2012

Commented:
You need to add the library to your project - either do that via "Priject|Add existing Item", navigate to the lub and select it or add

#pragma comment(lib,"libtiff.lib")

to one of your source code files.
Top Expert 2012
Commented:
Or, of course, as the 3rd way: Open your project's Properties (Alt+F7), go to 'Configuration Properties|Linker|Input' and add 'libtiff.lib' in 'Additional Dependencies'.

Author

Commented:
I tried the third way and I get cannot open libtiff.lib. Where is it suppose to be? Please be patient, I'm fairly new to Visual Studio.
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Author

Commented:
Also, when I do it the first way... I am asked to create a new rule and I don't know where to go from there
jkr
Top Expert 2012
Commented:
Do you have that file on your machine? You might have to specify the path to that file under 'Configuration Properties|Linker|General' in 'Additional Library Directories'. If you don't have it by now, get it from http://www.libtiff.org/
jkr
Top Expert 2012

Commented:
BTW, if you need CVS to check that out, that's available from http://www.nongnu.org/cvs/ - you might also find http://www.wincvs.org/ usefule.

Author

Commented:
ok... I stuck with the third way and it worked!

The other error was because I had the root folder in the Additional Library Directories instead of the libtiff folder.

Thanks!
jkr
Top Expert 2012

Commented:
You're most welcome ;o)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial