I'm trying to replicate the example of a simple XS module given at
https://www.lemoda.net/xs/xs-intro/geometry.html
I have this send_string.cpp file
#include "send_string.h"
#include "stdio.h"
void send_string (const wchar_t * str) {
printf ("string\n");
}
And the header send_string.h file is
void send_string (const wchar_t * str);
The package name is Kbh, and the Kbh.xs file is
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "send_string.h"
MODULE = Kbh PACKAGE = Kbh
PROTOTYPES: DISABLE
void
send_string(s)
const wchar_t * s
TYPEMAP: <<HERE
const wchar_t * T_PV
HERE
My Makefile.pl is
use ExtUtils::MakeMaker;
WriteMakefile (
NAME => 'Kbh',
VERSION_FROM => 'lib/Kbh.pm',
OBJECT => 'Kbh.o send_string.o',
)
My lib/Kbh.pm file is
package Kbh;
our $VERSION = '0.01';
require XSLoader;
XSLoader::load('Kbh', $VERSION);
1;
When I run dmake I get the linking error "Kbh.o:Kbh.c:(.text+0x75): undefined reference to `send_string'"
Thanks for any help
François
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.