Compilation error on "array.C"
jonilappalainen opened this issue · 5 comments
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.
The warnings and errors have to do with perls MULTIPLICITY option. I developed it with multiplicity, but it should be able to run without. You shouldn't worry about the warnings (though I agree they're ugly). The error on line 148 (a similar one exists in hash.C) is a bug. I just fixed locally and will upload it to github soon. There's a related but more complicated issue in the scalar binds, that will require more work :-(.
BTW, the reason it takes gcc-4.0 and not gcc-4.4 is probably because it picks the same compiler perl was compiled with. I think it's overridable by using the CC environmental variable but that may change in the near future as ExtUtils::CBuilder's C++ support improves.
Ok, thanks. I'll wait your update then. And yes, overriding the compiler using the CC environmental variable worked. I tried "perl Build.PL cc=gcc" before but that didn't work..
I hadn't thought of that, I should consider adding such an interface to my Build.PL/Build when I have the time
Hi Jon,
The latest version in git should compile without errors (assuming your perl comes with a shared libperl). There will be a lot of warnings though, I'm planning to get those out later.