Dear Ms./Sir, I am working on the problem of calling C++ functions from Perl. Your clear tutorial style web page: Gluing C++ And Perl Together gave me really great help. But what I am sticking now is that I have to embed a C++ function which asks two input parameters of <string> class data type like this:
void func(string c1, string c2, classA* c3); The typemap file are like this: TYPEMAP THES * O_OBJECT string O_OBJECT However, when I use make test to run the program, it reports bunches of lines like this: make test g++ -c -fno-strict-aliasing -I/usr/local/include -O2 -march=i386 -mcpu=i686 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC -I/usr/lib/perl5/5.6.1/i386-linux/CORE thesaurusLib.c thesaurusLib.c: In function `void XS_thesaurusLib_relatedness (CV *)': thesaurusLib.c:80: no matching function for call to `basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::basic_string (IV)' /usr/include/g++-3/std/bastring.h:176: candidates are: basic_string<charT, traits, Allocator>::basic_string () [with charT = char, traits = string_char_traits<char>, Allocator = __default_alloc_template<true, 0>] /usr/include/g++-3/std/bastring.h:177: basic_string<charT, traits, Allocator>::basic_string (const basic_string<charT, traits, Allocator> &) [with charT = char, traits = string_char_traits<char>, Allocator = __default_alloc_template<true, 0>] .... make: *** [thesaurusLib.o] Error 1 at the top of .xs file I have already included the header file like this: #include "string" The other parts are made by following the steps in your webpage. It seems that xsubpp cannot recognize the string class in C++, is it right? Or are there any ideas about this? This problem has puzzled me for days and I have to deal with it in order to continue my work. I really need your help or any ideas. Thanks in advance. Regards, Jane.