Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Unable to use created PerlXS Modul ( using c++ )

by lamchob (Initiate)
on Feb 11, 2014 at 09:57 UTC ( #1074374=note: print w/ replies, xml ) Need Help??


in reply to Unable to use created PerlXS Modul ( using c++ )

I've been tinkering a bit, and found the following baviour: When the Classfunctions of the c++ class are placed in the headerfile or the class is directly defined in the head of the .xs file like this:

class foo { public: foo(int a) { value = a; } private: int value; }
(like in http://www.johnkeiser.com/perl-xs-c%2B%2B.html another neat XS/C++ source), everything works as expected. The moment the class-definition is separated from the actual code, eg. having a .h and a .cpp file, the tests begin to fail. Additionally, reproducing EXMAPLE 4 of perlxstut (including a pure c lib with separate .h and .c files, no c++) works just fine.

Conclusion:

From what I see, the problem is somewhere located in the process where libmyclass.a is bound into Mytest.so, or in the creation of libmyclass.a itself.

PS: This is my first time posting something on perlmonks, and writing about your problem really hepls to think about it.wow. Any maybe this thread will help another lost XS-Soul on their journey...feels good, man :D


Comment on Re: Unable to use created PerlXS Modul ( using c++ )
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1074374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2015-07-28 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (257 votes), past polls