Jump to content
  • Advertisement
Sign in to follow this  
Milquetoasty

Libgd Problem

This topic is 2751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This code crashes on gdImageGifAnimBegin
#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

Share this post


Link to post
Share on other sites
Advertisement
You are using a libgd function that uses a FILE * parameter. If you use the precompiled libgd DLL you need to use MSVC 6. Since you are using MSVC 8, you'll need to compile libgd yourself.

Share this post


Link to post
Share on other sites
Hi, this topic is oudated but I add the same problem recently. I found a way to avoid it.

The solution is simple, since the problem is with the FILE* definition, don't use the gd function that take a FILE* as parameter. Instead use their *Ptr equivalent.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!