Hello everyone! Consider this small example:
#!/usr/bin/perl -w use strict; use Cairo; use SWF ':ALL'; use SWF::Constants ':Button'; my $surface = Cairo::ImageSurface->create('argb32', 10, 10); my $context = Cairo::Context->create($surface);
It throws an error:
Cannot convert scalar 0x8130af4 to an object of type Cairo::Surface at + cairo_vs_swf.pl line 10.
But if we remove the line use SWF::Constants ':Button'; everything is OK.

Now, the situation is this: I use both modules in my program, and those constants are necessary in my code. I suppose I could get rid of Cairo, because I have just one subroutine depending on it.
But trying to resolve the error I browsed through the source code of both modules, but as I am not at all fluent in XS (both libraries are written in C) I cannot win over this beast. So if anyone can clarify the matter, I would appreciate it.
Cairo version is 1.01 and ming is 0.3.0.

It's getting late (9PM) so I won't answer for a few hours, and I'm already working 11 hours on this program.


In reply to Cairo vs ming SWF by arkturuz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.