Git Product home page Git Product logo

leont / libperl-- Goto Github PK

View Code? Open in Web Editor NEW
68.0 17.0 27.0 416 KB

LibPerl++ is a C++ library that provides a more friendly interface for the the perl API. It makes use of advanced features of C++ to make both embedding and extending perl as easy as possible. This repository also contains to helper libraries that may be split out at a later stage: libtap++ and Library::Build.

C 39.33% C++ 46.32% Perl 13.31% Makefile 0.16% HTML 0.88%

libperl--'s Introduction

Libperl++

This is libperl++. A library for embedding and extending perl in C++.

DEPENDENCIES
The library should work on perl 5.8.1 or higher, though 5.10 is recommended. A
recent C++ compiler is required (GCC 4.4 or higher or (in the near future)
MSVC++ 2010). Also, some Boost headers are required to build it, but there are
no dependencies on Boost runtime libraries.

ISSUES

Building libperl++ on Windows currently doesn't work due to issues in Perl's
linking toolchain. This is being worked on.

INSTALLATION

To install this module, run the following commands:

	perl Build.PL
	./Build
	./Build test
	./Build install

For more information, see Install.pod

COPYRIGHT AND LICENCE

Copyright (C) 2007, 2008, 2009, 2010 Leon Timmermans
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

libperl--'s People

Contributors

leont avatar lightsey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libperl--'s Issues

Tap into it's own repo

Hi, I hope this question isn't stupid. I really like tap and I just found this implementation, but I don't really need any of the other stuff in here. Would it make sense to move tap itself into a different repo?

Compilation error on scalar.h

Hi.

I am trying to compile your project, and get an error:
blib\headers/perl++/scalar.h:185: error: expected identifier before 'void'
blib\headers/perl++/scalar.h:185: error: expected '}' before 'void'
blib\headers/perl++/scalar.h:185: error: expected unqualified-id before ',' token
blib\headers/perl++/scalar.h:185: error: two or more data types in declaration of 'SCALAR'
blib\headers/perl++/scalar.h:185: error: expected initializer before '}' token

line 185 is: enum context {VOID, SCALAR, LIST};

I am using Strewberry Perl 5.12 on Windows with MingW.
I tried, but could not spot the problem. maybe my C++ is out of shape...

Thanks,
Shmuel.

typecast_to is broken for C types. t/40-typecasts.C fails.

int foo = typecast_to(scalar);
is(foo, 1, "foo == 1");

This fails at run time in the 40-typecasts.C test. The cast function returns zero. I confirmed it also fails for other built in types including double and float.

The template specialization included below fixes specifically the "int" failure. My template fu is too weak to dive into interpreter.h.

=== modified file 't/40-typecasts.C'
--- t/40-typecasts.C 2011-04-28 01:57:56 +0000
+++ t/40-typecasts.C 2011-04-29 02:49:34 +0000
@@ -23,6 +23,15 @@
return variable.value;
}
};
+

  •   template<> struct typemap<int> {
    
  •       static int cast_to(const Scalar::Base& value) {
    
  •           return value.int_value();
    
  •       }
    
  •       static int cast_from(Interpreter&, const int variable) {
    
  •           return variable;
    
  •       }
    
  •   };
    
    }
    }

Error when compiling application

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 :)

Compilation Issue

Im getting following error compiler error in exporter.C, just few errors here
perl++/source/exporter.C:133:2: error: 'Argument_stack' does not name a type
perl++/source/exporter.C:133:2: error: 'PERL_MAGIC_uvar' was not declared in this scope

is() not printing the message

142c142,143

      bool ret = ok(2 * fabs(left - right) / (fabs(left) + fabs(right)) < epsilon);

      bool ret = 2 * fabs(left - right) / (fabs(left) + fabs(right)) < epsilon;
      ok(ret, message);

You forgot to modify is() to be like isnt()

compilation error in Install.pm

Needed to bring in "catdir" for ./Build to even run.

diff --git a/inc/Library/Build/Install.pm b/inc/Library/Build/Install.pm
index e80ac76..f401aa3 100644
--- a/inc/Library/Build/Install.pm
+++ b/inc/Library/Build/Install.pm
@@ -7,7 +7,7 @@ use warnings FATAL => 'all';
our $VERSION = '0.003';

use ExtUtils::Install qw/install uninstall/;
-use File::Spec::Functions qw/catfile/;
+use File::Spec::Functions qw/catfile catdir/;

sub install_dirs_for {
my ($builder, $location) = @_;

multiple constructors support

We've tried to use the library with multiple constructors on the c++ end to no avail.

It seems like only the last one registered is taken into account.

Would it be possible for multiple function definitions to be supported? I guess it is just a matter of mapping.

Thanks.

Path to header is wrong in libtap++ docs

The code in the libtap++.pod synopsis does not compile.

$ g++ foo.cpp
foo.cpp:1:21: fatal error: tap++.h: No such file or directory
compilation terminated.

The correct path is <tap++/tap++.h>

You can pull from my repo to get a fixed version.

specifying taint mode breaks tests for local::lib

The POD tests were skipped on my system. I was curious why, as I had Test::Pod installed. Turns out taint mod means $PERL5LIB gets ignored, and all my perl stuff lives in ~/perl5 thanks to local::lib.

Questionable if this is a bug or not, but here you go.

=== modified file 'inc/Library/Build/Test.pm'
--- inc/Library/Build/Test.pm 2011-04-28 01:57:56 +0000
+++ inc/Library/Build/Test.pm 2011-04-28 23:39:52 +0000
@@ -19,7 +19,7 @@
verbosity => $self->stash('verbose'),
exec => sub {
my (undef, $file) = @_;

  •           return -B $file ? [ $file ] : [ $^X, '-T', '-I' . catdir(qw/blib lib/), $file ];
    
  •           return -B $file ? [ $file ] : [ $^X, '-I' . catdir(qw/blib lib/), $file ];
        },
        merge => 1,
        color => -t STDOUT,
    

=== modified file 't/pod.t'
--- t/pod.t 2011-04-28 01:57:56 +0000
+++ t/pod.t 2011-04-28 23:37:34 +0000
@@ -1,5 +1,3 @@

-#!perl -T

use strict;
use warnings;
use Test::More;

Libperl++ This is libperl++. A library for embedding and extending perl in C++. DEPENDENCIES The library should work on perl 5.8.1 or higher, though 5.10 is recommended. A recent C++ compiler is required (GCC 4.4 or higher or (in the near future) MSVC++ 2010). Also, some Boost headers are required to build it, but there are no dependencies on Boost runtime libraries. ISSUES Building libperl++ on Windows currently doesn't work due to issues in Perl's linking toolchain. This is being worked on. INSTALLATION To install this module, run the following commands: perl Build.PL ./Build ./Build test ./Build install For more information, see Install.pod COPYRIGHT AND LICENCE Copyright (C) 2007, 2008, 2009, 2010 Leon Timmermans This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Compilation of examples failed - error: ambiguous overload for ‘operator=’

The build went successful - followed the instructions within the Install.pod file.

The examples however failed, please see the output below.

Environment information:

gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nikola@nikola-pc:/usr$ g++ --version
g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nikola@nikola-pc:/usr$ perl --version

This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
(with 53 registered patches, see perl -V for more detail)

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Trying to compile..

nikola@nikola-pc:~/projects/libperl--$ ./Build examples
mkdir _build/examples
cc -Iblib/headers -I/usr/lib/perl/5.10/CORE -fPIC --std=gnu++0x -ggdb3 -DDEBUG -Wall -Wshadow -Wnon-virtual-dtor ->Wsign-promo -Wextra -Winvalid-pch -c -x c++ -O2 -g -o _build/examples/combined.o ./examples/combined.C
cc -fstack-protector -L/usr/local/lib -o examples/combined _build/examples/combined.o -lperl++ -Lblib/so -lstdc++
cc -Iblib/headers -I/usr/lib/perl/5.10/CORE -fPIC --std=gnu++0x -ggdb3 -DDEBUG -Wall -Wshadow -Wnon-virtual-dtor ->Wsign-promo -Wextra -Winvalid-pch -c -x c++ -O2 -g -o _build/examples/game.o ./examples/game.C
cc -fstack-protector -L/usr/local/lib -o examples/game _build/examples/game.o -lperl++ -Lblib/so -lstdc++
cc -Iblib/headers -I/usr/lib/perl/5.10/CORE -fPIC --std=gnu++0x -ggdb3 -DDEBUG -Wall -Wshadow -Wnon-virtual-dtor ->Wsign-promo -Wextra -Winvalid-pch -c -x c++ -O2 -g -o _build/examples/Extend.o ./examples/Extend.C

./examples/Extend.C:14:1: warning: unused parameter ‘cv’
cc -shared -O2 -g -L/usr/local/lib -fstack-protector -o examples/Extend.so _build/examples/Extend.o -lperl++ -Lblib/so -lstdc++

cc -Iblib/headers -I/usr/lib/perl/5.10/CORE -fPIC --std=gnu++0x -ggdb3 -DDEBUG -Wall -Wshadow -Wnon-virtual-dtor -Wsign-promo -Wextra -Winvalid-pch -c -x c++ -O2 -g -o build/examples/Extend2.o ./examples/Extend2.C
./examples/Extend2.C:18:1: warning: unused parameter ‘cv’
In file included from blib/headers/perl++/perl++.h:49:0,
from ./examples/Extend2.C:1:
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_member_ptr<T, A>::method(interpreter
, perl::CV_) [with T = foo, A = std::basic_string, perl::CV = cv]’:
blib/headers/perl++/interpreter.h:481:4: instantiated from ‘void perl::implementation::export_member(interpreter_, const >char_, A T::) [with T = foo, A = std::basic_string]’
blib/headers/perl++/interpreter.h:692:4: instantiated from ‘typename boost::enable_if<typename boost::is_member_object_pointer::type, void>::type perl::Class::add(const char
, U T::) [with U = std::basic_string, T = foo, typename boost::enable_if<typename boost::is_member_object_pointer<U T::*>::type, >void>::type = void]’
./examples/Extend2.C:15:29: instantiated from here
blib/headers/perl++/interpreter.h:476:6: error: ambiguous overload for ‘operator=’ in ‘
>(((std::basic_string)perl::implementation::get_magic_object [with T = foo, perl::implementation::scalar::Variableperl::implementation::scalar::Value::Base = perl::implementation::scalar::Base]>(((const perl::implementation::scalar::Variableperl::implementation::scalar::Value::Base&)((const perl::implementation::scalar::Variableperl::implementation::scalar::Value::Base)(& perl::Argument_stack::operator[]>(unsigned int)(0u).perl::implementation::scalar::Temp_templateperl::implementation::scalar::Value::>.perl::implementation::scalar::Value::))))) + ((long unsigned int)ref)) = >perl::Argument_stack::operator[](unsigned int)(1u)’
/usr/include/c++/4.5/bits/basic_string.h:532:7: note: candidates are: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits, _Alloc = std::allocator, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string]
/usr/include/c++/4.5/bits/basic_string.h:540:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const CharT) [with _CharT = char, _Traits = std::char_traits, _Alloc = std::allocator, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string]
/usr/include/c++/4.5/bits/basic_string.h:551:7: note: std::basic_string<_CharT, _Traits, _Alloc>& >std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char, _Traits = std::char_traits, _Alloc = > std::allocator, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string]
/usr/include/c++/4.5/bits/basic_string.h:566:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char, >_Traits = std::char_traits, _Alloc = std::allocator, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string]
error building _build/examples/Extend2.o from './examples/Extend2.C' at /usr/share/perl5/ExtUtils/CBuilder/Base.pm line 175.
nikola@nikola-pc:~/projects/libperl--$

Could you please advise me on how to proceed further?

Compile error on Cygwin

I tried to build this on Cygwin (latest release). Following the instructions given, I got to the "./Build" step, which gave this output:


gcc-4 -Iblib/headers -Isource -I/usr/lib/perl5/5.10/i686-cygwin/CORE --std=gnu++0x -ggdb3 -DDEBUG -Wall -Wshadow -Wnon-virtual-dtor -Wsign-promo -Wextra -Winvalid-pch -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -x c++ -O3 -o _build/array.o perl++/source/array.C
In file included from blib/headers/perl++/perl++.h:41,
                 from perl++/source/array.C:2:
<built-in>:1:1: warning: "__STDC__" redefined
<built-in>: warning: this is the location of the previous definition
<built-in>:2:1: warning: "__STDC_HOSTED__" redefined
<built-in>: warning: this is the location of the previous definition
In file included from perl++/source/config.h:2,
                 from blib/headers/perl++/perl++.h:41,
                 from perl++/source/array.C:2:
/usr/lib/perl5/5.10/i686-cygwin/CORE/config.h:2839:1: warning: "VOIDUSED" redefined
In file included from perl++/source/internal.h:6,
                 from perl++/source/array.C:1:
/usr/lib/perl5/5.10/i686-cygwin/CORE/perl.h:32:1: warning: this is the location of the previous definition
In file included from blib/headers/perl++/perl++.h:49,
                 from perl++/source/array.C:2:
blib/headers/perl++/interpreter.h:8: error: expected initializer before ‘->’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_sub_1<R, A1, typename boost::disable_if<typename boost::is_convertible<perl::implementation::array::Temp, A1>::type, void>::type>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:257: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:257: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_sub_2<R, A1, A2>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:275: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:275: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:275: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_sub_3<R, A1, A2, A3>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:283: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:283: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:283: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:283: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_sub_v1<A1, typename boost::disable_if<typename boost::is_convertible<perl::implementation::array::Temp, A1>::type, void>::type>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:308: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:308: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_sub_v2<A1, A2>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:326: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:326: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:326: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_sub_v3<A1, A2, A3>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:335: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:335: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:335: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:335: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_method_1<R, T, A1, typename boost::disable_if<typename boost::is_convertible<perl::implementation::array::Temp, A1>::type, void>::type>::method(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:401: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:401: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::export_method_v1<T, A1, typename boost::disable_if<typename boost::is_convertible<perl::implementation::array::Temp, A1>::type, void>::type>::method(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:422: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:422: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::constructor_exporter<T>::arg1<A1>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:514: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:514: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::constructor_exporter<T>::arg2<A1, A2>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:523: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:523: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:523: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: In static member function ‘static void perl::implementation::constructor_exporter<T>::arg3<A1, A2, A3>::subroutine(interpreter*, perl::CV*)’:
blib/headers/perl++/interpreter.h:532: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/interpreter.h:532: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:532: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h:532: error: expected primary-expression before ‘>’ token
blib/headers/perl++/interpreter.h: At global scope:
blib/headers/perl++/interpreter.h:786: error: expected initializer before ‘->’ token
blib/headers/perl++/interpreter.h:906: error: expected initializer before ‘->’ token
blib/headers/perl++/interpreter.h:909: error: expected initializer before ‘->’ token
In file included from blib/headers/perl++/perl++.h:50,
                 from perl++/source/array.C:2:
blib/headers/perl++/typecasts.h: In static member function ‘static const std::pair<_T1, _T2> perl::typecast::typemap<std::pair<_T1, _T2>, void>::cast_to(const perl::implementation::scalar::Value&)’:
blib/headers/perl++/typecasts.h:30: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/typecasts.h:30: error: expected primary-expression before ‘(’ token
blib/headers/perl++/typecasts.h:30: error: expected primary-expression before ‘>’ token
blib/headers/perl++/typecasts.h:30: error: expected primary-expression before ‘>’ token
blib/headers/perl++/typecasts.h: In static member function ‘static const std::vector<T, std::allocator<_CharT> > perl::typecast::typemap<std::vector<T, std::allocator<_CharT> >, void>::cast_to(const perl::Array&)’:
blib/headers/perl++/typecasts.h:48: error: ‘typecast_to’ was not declared in this scope
blib/headers/perl++/typecasts.h:48: error: expected primary-expression before ‘>’ token
error building _build/array.o from 'perl++/source/array.C' at /usr/local/lib/perl5/5.10/ExtUtils/CBuilder/Base.pm line 115.

Compilation error on "array.C"

I'm trying to build but it fails. My gcc is version 4.4.2 and Perl is 5.10.1. I'm running osx 10.5.8 (Leopard).
It's somehow forced to try to compile with gcc-4.0 even when I have the 4.4.2. I manually linked the 4.4.2 version to point to gcc-4.0 but I'm still getting error:

$perl Build.PL
$perl Build 
/usr/bin/gcc-4.0 -Iblib/headers -Isource -I/opt/local/lib/perl5/5.10.1/darwin-2level/CORE --std=gnu++0x -ggdb3 -DDEBUG -Wall -Wshadow -Wnon-virtual-dtor -Wsign-promo -Wextra -Winvalid-pch -c -I/opt/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include -x c++ -O3 -o _build/array.o perl++/source/array.C

gcc-4.0: unrecognized option '-no-cpp-precomp'
perl++/source/array.C:14: warning: unused parameter 'interp'
perl++/source/array.C: In member function 'perl::implementation::array::Length& perl::implementation::array::Length::operator=(unsigned int)':
perl++/source/array.C:39: warning: unused variable 'interp'
perl++/source/array.C: At global scope:
perl++/source/array.C:99: warning: unused parameter 'interp'
perl++/source/array.C:141: warning: unused parameter 'interp'
perl++/source/array.C:148: error: invalid conversion from 'int ()(interpreter, perl::SV_, perl::MAGIC_)' to 'int ()(SV, MAGIC*)'
/opt/local/lib/perl5/5.8.9/darwin-2level/CORE/patchlevel.h:122: warning: 'perl::local_patches' defined but not used
error building _build/array.o from 'perl++/source/array.C' at /opt/local/lib/perl5/site_perl/5.8.9/ExtUtils/CBuilder/Base.pm line 115.

compilation failed in vc++2010 scaler.h

I created a new MSVC project added all your files.
After adding few undefs in internel.h
I am getting compilation errors related to perl::implementation::array::Temp
The issue is with compiler it mixes up typename with declaration

1>e:\ani\leont-libperl---7a91ac7\perl++\scalar.h(389): error C2027: use of undefined type 'perl::implementation::array::Temp'
1> e:\ani\leont-libperl---7a91ac7\perl++\scalar.h(198) : see declaration of 'perl::implementation::array::Temp'

Regards
Anand

Error in PL.pm: Can't use an undefined value as an ARRAY reference

read_config returns an empty hash reference on my machine, as I have no modulebuildrc file. This leads to a fatal dereference of a null value. Suggest attached change.

--- a/inc/Library/Build/PL.pm
+++ b/inc/Library/Build/PL.pm
@@ -22,11 +22,13 @@ my %registries = (
 
 sub new {
    my ($class, @args) = @_;
    my %args = (
        argv   => \@ARGV,
-       config => [ map { @{$_} } @{Library::Build::Config::read_config('Build_PL')}{'*', 'Build_PL'} ],
+       config => [ map { @{$_} } grep { $_ } @{Library::Build::Config::read_config('Build_PL')}{'*', 'Build_PL'} ],
        @args
    );
    return bless \%args, $class;
 }

Need libraries installed before tests work

Running the tests on a clean system produces

Report 110504-12:01
t/00-sanity.t ............ ok     
t/10-integer.t ........... ok     
t/10-number.t ............ ok     
t/10-scalar.t ............ ok     
t/10-string.t ............ ok   
t/10-uinteger.t .......... ok     
t/20-references.t ........ ok     
t/20-subrefs.t ........... ok     
t/30-array.t ............. ok     
t/30-glob.t .............. skipped: Tests not implemented yet
t/30-hash.t .............. ok     
t/30-regex.t ............. ok   
t/40-objects.t ........... ok     
t/40-pack.t .............. ok   
t/40-typecasts.t ......... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests 
t/50-binds.t ............. ok   
t/50-function-exports.t .. ok   
t/50-method-exports.t .... ok   
t/50-tie.t ............... skipped: Tests not implemented yet
t/pod-coverage.t ......... ok   
t/pod.t .................. ok   

Test Summary Report
-------------------
t/40-typecasts.t       (Wstat: 256 Tests: 4 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=21, Tests=369,  1 wallclock secs ( 0.17 usr  0.09 sys +  0.18 cusr  0.17 csys =  0.61 CPU)
Result: FAIL

Looking at what specifically failed, I got a shared library load error.

$ t/40-typecasts.t 
t/40-typecasts.t: error while loading shared libraries: libperl++.so: cannot open shared object file: No such file or directory

When I do a
./Build install; ./Build clean; ./Build test

Then I get:

$ t/40-typecasts.t 
1..4
not ok 1 - foo == 1
# Failed test 'foo == 1'
#        Got: 0
#   Expected: 1
ok 2 - bar.value == 1
ok 3 - typecast_from(1) == 1
ok 4 - typecast_from(bar) == 1

Which is what is expected until issue #8 is resolved

perl's seed macro conflicts with g++ std::algorithm header

Get loads of errors like these:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/random.h:198:17: error: macro "seed" passed 1 arguments, but takes just 0

There's some conflict between std::algorithm and perl.h, at least in recent g++.
Fix by adding an "undef seed".

=== modified file 'perl++/source/internal.h'
--- perl++/source/internal.h 2011-04-28 01:57:56 +0000
+++ perl++/source/internal.h 2011-04-29 02:21:09 +0000
@@ -22,3 +22,5 @@
#define MAGIC TAIL
#endif
#undef call_list
+
+#undef seed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.