Exceptions were a piece of cake (Thanks!)... Multiple objects isn't going too well thus far.
1. Since you specifically state that you have to use the "OBJECTS" parameter, does this mean using MYEXTLIB and targeting a shared library is out of the question? 2. What is My.pm ? This isn't covered anywhere in the perldoc for ExtUtils::MakeMaker. Do I create My.pm loose in the directory where h2xs generates the lib directory? 3. Where did you find documentation on all this boot_* stuff? I've been looking around, and don't see it mentioned anywhere! 4. In my "lib" directory should I have a ".pm" for each C++ class I want to be able to use? (h2xs only created a ".pm" file for the first library). (I am pretty sure you're going to say yes, but I want to understand what the approach is for doing this). Also, I think h2xs is causing me more headaches than it's worth at this point. As soon as I get this multiple C++ objects issue nailed, I'll write another summary on Perlmonks. Thanks again for your help! -Ryan Dietrich On Sat, Aug 7, 2010 at 5:53 AM, Mattia Barbon <mattia.bar...@libero.it>wrote: > > 2. How do you map multiple custom C++ objects out of a single header file >> using XS? >> > > There are two approaches: > > 1 - you can split the XS code in multiple XS files and then include them > all in a single top-level file, using the INCLUDE: directive; in this case > you do not need to do anything special > 2 - if you do it the way Wx does, you need to list all the object files for > XS top-level modules in the OBJECTS MakeMaker parameter; every top-level XS > file must have a different MODULE directive; one of the XS files must have a > MODULE directive matching the .pm module name, and in this module you need > to add this code: > > // in the C section > extern "C" { > XS( boot_SubModule1 ); > XS( boot_Another_Sub_Module ); > ... > } > > // in the XS section: > BOOT: > newXSproto( "My::_boot_SubModule1", boot_SubModule1, file, "$$" ); > ... > > // in the My.pm file > _boot_SubModule1( 'My', $XS_VERSION ); > > Note that Wx uses a hybrid approach (multiple top-level XS files that each > include multiple XS files from the XS subdirectory). > >