Subject: | fft.c(272) : error C2065: 'M_PI' : undeclared identifier ... |
Hi.
E:\new\Audio-1.000>perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Audio::Data
Writing Makefile for Audio::Play::MSWin32
Testing for Network Audio Server (NAS)
Cannot build Audio::Play::Net - NAS not present
Writing Makefile for Audio::Play
Writing Makefile for Audio
E:\new\Audio-1.000>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cp Tk/Scope.pm blib\lib\Tk\Scope.pm
cp Data/touchtone.3.au ..\blib\lib\Audio\Data\touchtone.3.au
cp Data/touchtone.pound.au ..\blib\lib\Audio\Data\touchtone.pound.au
cp Audio.h ..\blib\arch\Audio\Audio.h
cp Data/touchtone.4.au ..\blib\lib\Audio\Data\touchtone.4.au
cp Audio.m ..\blib\arch\Audio\Audio.m
cp Data/touchtone.5.au ..\blib\lib\Audio\Data\touchtone.5.au
cp Data/touchtone.6.au ..\blib\lib\Audio\Data\touchtone.6.au
cp Audio.t ..\blib\arch\Audio\Audio.t
cp Data/touchtone.7.au ..\blib\lib\Audio\Data\touchtone.7.au
cp Data.pm ..\blib\lib\Audio\Data.pm
cp Data/touchtone.0.au ..\blib\lib\Audio\Data\touchtone.0.au
cp Data/touchtone.8.au ..\blib\lib\Audio\Data\touchtone.8.au
cp typemap ..\blib\arch\Audio\typemap
cp Data/touchtone.9.au ..\blib\lib\Audio\Data\touchtone.9.au
cp Data/touchtone.1.au ..\blib\lib\Audio\Data\touchtone.1.au
cp Audio_f.h ..\blib\arch\Audio\Audio_f.h
cp Data/touchtone.star.au ..\blib\lib\Audio\Data\touchtone.star.au
cp Filter.pm ..\blib\lib\Audio\Filter.pm
cp Data/touchtone.2.au ..\blib\lib\Audio\Data\touchtone.2.au
cl -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_
MSVCRT_READFIX -O1 -MD -DNDEBUG -DVERSION=\"1.000\" -DXS_VERSION=\"1.000\" -IC:\Perl\lib\CORE AudioIO.c
AudioIO.c
cl -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_
MSVCRT_READFIX -O1 -MD -DNDEBUG -DVERSION=\"1.000\" -DXS_VERSION=\"1.000\" -IC:\Perl\lib\CORE Audio_f.c
Audio_f.c
C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib C:\Perl\lib\ExtUtils/xsubpp -typemap C:\Perl\lib\ExtUtils\typemap -typemap typemap
Data.xs > Data.xsc && C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib -MExtUtils::Command -e mv Data.xsc Data.c
cl -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_
MSVCRT_READFIX -O1 -MD -DNDEBUG -DVERSION=\"1.000\" -DXS_VERSION=\"1.000\" -IC:\Perl\lib\CORE Data.c
Data.c
cl -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_
MSVCRT_READFIX -O1 -MD -DNDEBUG -DVERSION=\"1.000\" -DXS_VERSION=\"1.000\" -IC:\Perl\lib\CORE fft.c
fft.c
fft.c(272) : error C2065: 'M_PI' : undeclared identifier
fft.c(417) : error C2057: expected constant expression
fft.c(417) : error C2466: cannot allocate an array of constant size 0
fft.c(417) : error C2133: 'tmp' : unknown size
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
I can fix the first part by adding
#include <gsl/gsl_math.h>
to fft.c
Now as to the second error, the code is
/* This is lifted from EST */
int
Audio_lpc(int length, const float *sig, int order, float *acf,
float *ref, float *lpc)
{
int i, j;
float e, ci, sum;
float tmp[order]; ///// the troubling line
int stableorder=-1;
I'm not a C expert, but I go ahead and make that
float *tmp;
tmp = malloc(order * sizeof(float));
And then errors popup in
l2u.c
l2u.c(559) : error C2054: expected '(' to follow 'inline'
l2u.c(560) : error C2085: 'Max' : not in formal parameter list
l2u.c(560) : error C2143: syntax error : missing ';' before '{'
l2u.c(581) : warning C4028: formal parameter 1 different from declaration
l2u.c(593) : warning C4028: formal parameter 1 different from declaration
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
Oh boy.
SO i go to line 581 and remove inline from
static inline long
Max(int bits)
...
And I am faced with
E:\new\Audio-1.000>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_
MSVCRT_READFIX -O1 -MD -DNDEBUG -DVERSION=\"1.000\" -DXS_VERSION=\"1.000\" -IC:\Perl\lib\CORE l2u.c
l2u.c
l2u.c(581) : warning C4028: formal parameter 1 different from declaration
l2u.c(593) : warning C4028: formal parameter 1 different from declaration
cl -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_
MSVCRT_READFIX -O1 -MD -DNDEBUG -DVERSION=\"1.000\" -DXS_VERSION=\"1.000\" -IC:\Perl\lib\CORE rate.c
rate.c
"Running Mkbootstrap for Audio::Data ()"
C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib -MExtUtils::Command -e chmod 644 Data.bs
C:\Perl\bin\perl.exe "-IC:\Perl\lib" "-IC:\Perl\lib" -MExtUtils::Mksymlists -e "Mksymlists('NAME' => 'Audio::Data', 'DLBASE' => 'Da
ta', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);"
link -out:..\blib\arch\auto\Audio\Data\Data.dll -dll -nologo -nodefaultlib -release -libpath:"C:/Perl\lib\CORE" -machine:x86 Audio
IO.obj Audio_f.obj Data.obj fft.obj l2u.obj rate.obj C:\Perl\lib\CORE\perl56.lib oldnames.lib kernel32.lib user32.lib gdi32.lib winsp
ool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc
32.lib odbccp32.lib msvcrt.lib -def:Data.def
Creating library ..\blib\arch\auto\Audio\Data\Data.lib and object ..\blib\arch\auto\Audio\Data\Data.exp
Data.obj : error LNK2001: unresolved external symbol _drand48
..\blib\arch\auto\Audio\Data\Data.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
Now in Data.xs line 129, I see
*buf = amp * (drand48()-0.5);
Is this supposed to be a call to some drand function?
I took a shot in the dark and changed that to
*buf = amp * (rand(48)-0.5);
And it compiled OK, but some warnings:
MSWin32.xs(182) : warning C4133: 'function' : incompatible types - from 'struct _PerlIO *' to 'struct _iobuf *'
...
I did a nmake test, and got a bunch of Memory Access Violations
along with
\init.t t\load.t t\overload.t
Using E:/new/Audio-1.000/Data/../blib
t\init........dubious
Test returned status 5 (wstat 1280, 0x500)
t\load........ok
t\overload....dubious
Test returned status 5 (wstat 1280, 0x500)
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\init.t 5 1280 ?? ?? % ??
t\overload.t 5 1280 ?? ?? % ??
Failed 2/3 test scripts, 33.33% okay. 0/2 subtests failed, 100.00% okay.
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.