Subject: | memcpy undefined |
Date: | Fri, 20 Dec 2019 20:09:56 +0200 |
To: | bug-Algorithm-SVM [...] rt.cpan.org |
From: | andreashad2 <andreashad2 [...] googlemail.com> |
Hi,
I got a problem instaling Algorithm::SVM
but the fix is trivial: add:
#include <cstring>
in bindings.cpp (just after <errno.h>)
cp lib/Algorithm/SVM.pm blib/lib/Algorithm/SVM.pm
AutoSplitting blib/lib/Algorithm/SVM.pm (blib/lib/auto/Algorithm/SVM)
cp lib/Algorithm/SVM/DataSet.pm blib/lib/Algorithm/SVM/DataSet.pm
Running Mkbootstrap for SVM ()
chmod 644 "SVM.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- SVM.bs
blib/arch/auto/Algorithm/SVM/SVM.bs 644
"/usr/bin/perl" "/usr/share/perl5/vendor_perl/ExtUtils/xsubpp" -C++
-noprototypes -typemap '/usr/share/perl5/ExtUtils/typemap' -typemap
'/root/.cpanm/work/1576864822.22056/Algorithm-SVM-0.13/typemap' SVM.xs
Show quoted text
> SVM.xsc
mv SVM.xsc SVM.c
g++ -c -Wall -O3 -DVERSION=\"0.13\" -DXS_VERSION=\"0.13\" -fPIC
"-I/usr/lib64/perl5/CORE" SVM.c
g++ -c -Wall -O3 -DVERSION=\"0.13\" -DXS_VERSION=\"0.13\" -fPIC
"-I/usr/lib64/perl5/CORE" libsvm.cpp
g++ -c -Wall -O3 -DVERSION=\"0.13\" -DXS_VERSION=\"0.13\" -fPIC
"-I/usr/lib64/perl5/CORE" bindings.cpp
bindings.cpp: In member function ‘void DataSet::realign(svm_node*)’:
bindings.cpp:39:2: error: ‘memcpy’ was not declared in this scope
39 | memcpy(address,attributes,sizeof(struct svm_node)*(n+1));
| ^~~~~~
bindings.cpp:2:1: note: ‘memcpy’ is defined in header ‘<cstring>’; did
you forget to ‘#include <cstring>’?
1 | #include "bindings.h"
+++ |+#include <cstring>
2 | #include <errno.h>
bindings.cpp: In member function ‘void DataSet::setAttribute(int, double)’:
bindings.cpp:50:3: error: ‘memcpy’ was not declared in this scope
50 | memcpy(address,attributes,sizeof(struct svm_node)*(n+1));
| ^~~~~~
bindings.cpp:50:3: note: ‘memcpy’ is defined in header ‘<cstring>’; did
you forget to ‘#include <cstring>’?
make: *** [Makefile:351: bindings.o] Error 1