2006.08.04 15:56 "[Tiff] libtiff and MSVC 6 Update", by Sean Burke

2006.08.04 15:56 "[Tiff] libtiff and MSVC 6 Update", by Sean Burke

Bernie, etc.,

Going off of a post in an unrelated subject, I compiled an executable that calls the dll library function. (See post on 2006.08.03 for source.) This code compiles without complaint:

#import "write2DTIFF.h"
int main(int argc, char *argv){
    printf("Calling write:\n");
    if((write2DTIFF()) == 1){
        printf("write2DTIFF failed.\n");
    printf("write2DTIFF sucessful.\n");
    return 1;

When I compile it as an exe in VC6, the error given by the debugger is the same as was previously mentioned (Unhandled exception in testTW.exe (LIBTIFF3.DLL): 0xC0000005. Access Violation.). Since I am using VC6 and not 7, I assume that the "Enable Just-in-time debugging" is analogous to "When the exception is thrown: Break into the debugger" in VC7.

I recompiled the code with gcc/cygwin. When executed it throws an exception, but this one is a little more detailed:

eax=00000000 ebx=00000004 ecx=009A1FA0 edx=009A1FA0 esi=00000090
ebp=00000100 esp=0022ECD8 program=c:\Program Files\Microsoft Visual
Studio\MyProjects\write2DTIFF\Debug\write2DTIFF.exe, pid 5252, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame Function Args
      6 [main] write2DTIFF 5252 _cygtls::handle_exceptions: Error while
dumping state (probably corrupted stack)

In both cases, my dll is linked to libtiff.lib - presumably the static library.

On the subject of TIFFOpen, it does appear that some default values are written if the program terminates before any other commands are called.

Sean Burke
Imaging Analysis Specialist
Albert Einstein College of Medicine
1300 Morris Park Avenue
Bronx, NY 10461
PH: 718.430.8628