-
2009.03.03 21:04 "Re: [Tiff] Building Libtiff in Visual Studio under Windows?", by Bob Friesenhahn
- 2009.03.03 21:10 "Re: [Tiff] Building Libtiff in Visual Studio under Windows?", by Steven Lehar
2009.03.03 20:51 "[Tiff] Building Libtiff in Visual Studio under Windows?", by Steven Lehar
Hi,
I'm having trouble building Libtiff in Windows, both on a win32 XP machine, and also on a 64-bit Vista machine. I have the same problem on both machines. Maybe I'm making a simple mistake. Can somebody help me?
I downloaded the Windoz binaries from http://gnuwin32.sourceforge.net/packages/tiff.htm (maybe this is the problem for my 64-bit Vista machine, although it SHOULD work, but thats why I tried again with my win32 XP machine) and installed it at
C:\Program Files (x86)\GnuWin32
I opened a new Win32 Console Application project named "TestTiff".
Under Header Files, in stdafx.h I added the line:
#include "tiffio.h"
In Project > Properties > C/C++ > Additional Include Directories I added
"C:\Program Files (x86)\GnuWin32\include"
In Project > Properties > Linker > Additional Library Dependencies I added
"C:\Program Files\GnuWin32\lib
Then in TestTiff.cpp after int _tmain(int argc, _TCHAR* argv[]){ I added
// Open Tif Image
TIFF* tifImg = TIFFOpen("TestImage.tif", "r");
(making sure to have a "TestImage.tif" in the local folder). But when I tried to build, I got:
Linking...
LINK: Fatal error LNK1104: Cannot open file 'C:\Program Files (x86)\GnuWin32\lib\libtiff.lib;'
This was all on the Vista 64 machine (the "Program Files (x86)" folder is for 32-bit programs)
When I did exactly the same sequence on my Win32 XP machine, and tried to build, I got:
error LNK2019: unresolved external symbol __imp__TIFFOpen referenced in function _wmain.
fatal error LNK1120: 1 unresolved externals.
What am I doing wrong?