Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

XS namespace problem

by rrwo (Friar)
on Jun 29, 2005 at 09:39 UTC ( [id://470943]=perlquestion: print w/replies, xml ) Need Help??

rrwo has asked for the wisdom of the Perl Monks concerning the following question:

I am rewriting the Algorithm::SkipList module so that the node class (Algorithm::SkipList::Node) is in C (which spaves a ton of memory, not to mention a little faster).

The problem is that the module won't build:

ExtUtils::Mksymlists::Mksymlists('lib\Algorithm\SkipList\Node') Generating script 'lib\Algorithm\SkipList\Node.lds' link @"lib\Algorithm\SkipList\Node.lds" -out:"blib\arch\auto\Algorithm +\SkipList\ Node\Node.dll" lib\Algorithm\SkipList\Node.obj : warning LNK4042: object specified mo +re than on ce; extras ignored lib\Algorithm\SkipList\Node.obj : warning LNK4042: object specified mo +re than on ce; extras ignored Node.def : error LNK2001: unresolved external symbol boot_Algorithm__S +kipList Node.def : error LNK2001: unresolved external symbol boot_Algorithm__S +kipList blib\arch\auto\Algorithm\SkipList\Node\Node.lib : fatal error LNK1120: + 2 unresol ved externals LINK : fatal error LNK1141: failure during build of exports file

I think this is because the Node.def file defines the bootstrap name for Algorithm::SkipList rather than Algorithm::SkipList::Node:

LIBRARY "Node" EXPORTS boot_Algorithm__SkipList _boot_Algorithm__SkipList = boot_Algorithm__SkipList

I suspect there's a problem with ExtUtils::Mksymlists, but I'm not sure.

I would rather not make Algorithm::SkipList::Node a separate module (which seems to be the only workaround that I'm aware of). Is there a better way to fix this, or have I run into a limitation or bug with ExtUtils::MakeMaker?

Replies are listed 'Best First'.
Re: XS namespace problem
by anonymized user 468275 (Curate) on Jun 29, 2005 at 10:56 UTC
    Assuming that all your data definitions for mocking C up to look like perl are okay, it sounds like a make problem to me, i.e. that it is still trying to build the old perl version into the the namespace; perhaps we can see the makefile?

    One world, one people

Re: XS namespace problem
by PodMaster (Abbot) on Jun 29, 2005 at 12:19 UTC
    Its best if you provide a copy of what you have so far for us to try.

    The build process starts with perl Makefile.PL and ends with make, and you should show everything that gets printed to the screen by those (or their equivalents -- Build.PL...).

    When you encounter a problem, make sure you do make realclean before reporting any bugs (especially during development).

    Judging by the .lds I'm guessing that you're not using ExtUtils::MakeMaker (you're using ExtUtils::CBuilder), so make sure you have the latest and the greatest version of it (same goes for ExtUtils::MakeMaker and ExtUtils::ParseXS).

    Try "findstr /s /i boot_Tie__PureDB *" and see if Node.c shows up as containing that string (it should). If it doesn't, make sure you make realclean and try again.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://470943]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2025-01-18 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (56 votes). Check out past polls.