-
Problem With The Libgd
This code crashes on gdImageGifAnimBegin
Code:
#include <gd.h>
#include <string.h>
int main(int argc, CHAR ** argv)
{
gdImagePtr im = gdImageCreate(100, 100);
FILE * out = fopen("anim.gif", "wb");
if(out)
{
gdImageGifAnimBegin(im, out, 1, -1);
gdImageGifAnimEnd(out);
fclose(out);
}
gdImageDestroy(im);
return 0;
}
Unhandled exception at 0x7c918fea (ntdll.dll) in Stupid.exe: 0xC0000005: Access violation writing location 0x00000010.
ntdll.dll!_RtlpWaitForCriticalSection@4() + 0x5b bytes
ntdll.dll!_RtlEnterCriticalSection@4() + 0x46 bytes
msvcrt.dll!__lock_file() + 0x33 bytes
msvcrt.dll!_fwrite() + 0x14 bytes
bgd.dll!1000c39a()
I can't understand why it is failing on this section. I am using Microsoft Visual Studio 8, and the shared library DLL is compiled with VC6 under multithreaded mode
Does anyone know why
-
> FILE * out = fopen("anim.gif", "wb");
Just out of curiosity, have you tried opening the file in read mode instead of write mode?
-
-
The problem was the that the binary distribution of the libgd that I was using was compiled with VC6, which was incompatible with me. I had to compile the library which was a bit of an ordeal, but I'd like to thank the the libgd support crew. It works now!
-
Hello all,
I'm having the same problem. Can you give me a summary of how to compile libgd using MS Visual Studio 8, because the version delivered on the site did not worked :(
I'm using MSVC 8 on an Windows system.
Or, can you, please, give me the library compiled by you.. I think it will work.
I'm disperate, I have to finish a task at work in 3 days and I've already lost this day trying to make it work, but useless.
Thanks in advance,
Raz