2005.04.02 17:18 "Re: [Tiff] MSVC & LibTIFF issues", by Andrey Kiselev
On Sat, Apr 02, 2005 at 11:16:28AM -0500, Phillip Wiles wrote:
I am using MS VC 6.0. I have read over all the documents and built the
> .lib & .dll. And I have used a tutorial (1) to try and help make sure
that the settings are correct (except for creating the and using dlibtiff.lib in the debug mode, just using the libtiff.lib in I?m debug mode).
I am getting the following errors when I try to compile: MSVCRT.lib(MSVCRT.dll): error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj) MSVCRT.lib(MSVCRT.dll): error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
I have read & search over the mailing list archive and found this post which is same issue that I having (2). I have read the response and understand the reason of the error, but still having trouble figuring out what I need to do to correct it. The tutorial (1) warns of this problem and I have double checked that my settings match. Either the answer is staring me in the face, or it is not there to be found.
My question/help request is can you please point at what specifically needs to be changed so that I will not have this issue?
The way to build libtiff, described in the tutorial you are mentioned is not supported by the developers. Libtiff comes with a set of makefiles and configuration file (nmake.opt) where the build parameters defined. You should edit the line OPTFLAGS. The most important option is /MD. With this option compiler will use dynamically linked multitreaded runtime libraries. If libtiff is built with the /MD option, the other software you want link against libtiff must be built in the same manner.
There is short and incomplete reference how to build libtiff with the MSVC compiler:
Andrey V. Kiselev
Home phone: +7 812 5970603 ICQ# 26871517