Hi, there has been some posts about making flash ( .swf ) files with Perl. There is SWF::Builder which works fine, and there is also Ming, which uses xs to use libming.

Well I have encountered (and solved) a problem getting the latest beta to run with Perl.

The latest version which would build for Perl, without problem is version 0.2a, which didn't have gif and png support. The latest version 0.3beta1 will give you errors "undefined symbol for DGifSlurp" when you try to run "make test" under Perl. Well it took me a few hours to track down the problem, but this is how to fix it.

0.3beta1 works with the following corrections.

1. In the ming/src directory,
   change the lines in Makefile from
   LDFLAGS = -lm -lz # -ldmalloc
   to
   LDFLAGS = -lm -lz -lungif -lpng12 # -ldmalloc


2. In the perl_ext directory, run
   perl Makefile.PL
   and open the Makefile

   Find the lines
    # SWF might depend on some other libraries:
    # See ExtUtils::Liblist for details
    #
    EXTRALIBS = -lz
    LDLOADLIBS = -lz

and change them to

    # SWF might depend on some other libraries:
    # See ExtUtils::Liblist for details
    #
    EXTRALIBS = -lz -lungif -lpng12
    LDLOADLIBS = -lz -lungif -lpng12

Now do your make and make install and the perl examples will run.

Ming can be found here. Ming

and a nice site with alot of sample code is at

Brinkster-Ming


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re: Running SWF with Ming
by tachyon (Chancellor) on Oct 06, 2004 at 02:29 UTC

    ++ but patching the Makefile generated by ExtUtils::MakeMaker in the Makefile.PL is the wrong/hard way to do it. Just get MakeMaker to write the correct Makefile by editing the Makefile.PL as shown:

    - 'LIBS' => [ "-lz" ], + 'LIBS' => [ "-lz", "-lungif", "-lpng12" ],

    cheers

    tachyon

      Thanks Tachyon, I knew someone would know how to "do it right". :-)

      I'm not really a human, but I play one on earth. flash japh