Yes, i know that. But XS is actually needed since i want to write a OO interface to a (non trivial) Win32 C API.
(and for sure, i know how to walk! :) )
so for now i have the following code
Foo-Bar/typemap
TYPEMAP
PBar T_PTROBJ
Foo-Bar/Bar.xs
typedef struct __Bar {
// ...
} Bar, *PBar;
MODULE = Foo::Bar PACKAGE = Foo::Bar
PBar
new(class);
const char* class
PREINIT:
PBar retval;
CODE:
New(0, retval, 1, Bar);
RETVAL = retval;
OUTPUT:
RETVAL
Foo-Bar-Builder/typemap
TYPEMAP
PBarBuilder T_PTROBJ
PBar T_PTROBJ
Foo-Bar-Builder/Builder.xs
typedef struct __BarBuilder {
// ...
} BarBuilder, *PBarBuilder;
MODULE = Foo::Bar::Builder PACKAGE = Foo::Bar::Builder
PBarBuilder
new(class);
const char* class
PREINIT:
PBarBuilder retval;
CODE:
New(0, retval, 1, BarBuilder);
RETVAL = retval;
OUTPUT:
RETVAL
MODULE = Foo::Bar::Builder PACKAGE = Foo::Bar::BuilderPtr
PBar
create(void);
PREINIT:
PBar retval;
CODE:
RETVAL = retval;
OUTPUT:
RETVAL
so, the question is:
do i have to call Foo::Bar::new inside Foo::Bar::Builder::create? or do i have to reimplement the new function of Foo::Bar::new inside Foo::Bar::Builder, or what?
so, the Foo::Bar::new is now defined inside the Foo/Bar/Bar.dll, and the C compiler does not know, where to find it. I guess it does not help to link against Foo\Bar\Bar.lib, since the dll just exports
1 0 00001000 _boot_Foo__Bar
2 1 00001000 boot_Foo__Bar
Get the point?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.