Leont/libperl--

Error when compiling application

stew822 opened this issue · 6 comments

Hello there!
I'm running Linux Ubuntu (10.10) with Perl 5.10.1 and I downloaded the whole kaboodle, downloaded a couple of packages that the doc said I needed, compiled it (following the instructions to the letter) and when I try to compile a simple file I get heaps and heaps of error messages. Here's my file:
#include <perl++/perl++.h>
int main () {
wPerl perl;
perl.eval("print q(Hello, world!\n)");
return 0;
}
So I try to compile that with:
g++ -lperl++ perl-i.cpp
and also try
gcc -lperl++ perl-i.cpp
to no avail. My errors are contained in this pastebin: http://pastebin.com/m5Gtvuyk
I'm not quite sure what's happening wrong ;). I dunno if it's me or you, but yeah, this library looks awesome and I'd really like to get it working :)

Oh, my gcc/g++ version is:
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)

Your pastebin link doesn't work, but I can tell you why it doesn't work: the code is all wrong. There's a 14 years old library with the same name (I didn't know about it when I started this project, but since the other project is completely dead I let it be) and I think you used an example from that one. In my libperl++ that would be more like

#include <perl++/perl++.h>
using namespace perl;
int main () {
    Interpreter perl;
    perl.eval("print q(Hello, world!\n)");
    return 0;
}

hmm that's a bit odd about that pastebin. Here's a new one (I got that when I compiled your code):
http://codepad.org/iP9YiWRw
So I still get the errors. I think I may have tried to install the other one (without realising how old it is) and maybe it left behind something that's interfering with your library? I'll go check it out :). Thanks for responding quickly :)

Nope I tried deleting the file that's causing the errors then reinstalling, to no avail. Same errors, all in the same interpreter.h & typecast.h file. :(

Ah, that gives me some more clues. You need to specify this option to gcc for it to be able to parse the code: --std=gnu++0x. I should add something about that in my documentation I guess.

That works perfectly! Thanks heaps! :). My little app compiled perfectly :)
Yeah, adding something in your doc would be a good idea :). Well it's reassuring to know it was my fault anyway :)
Thanks :)