Hi, Folks,
I have created a program called wpp~ which executes the WaveTrans
function from the wavelet library wave++. My big problem here is
knowing how to program the code for an external in C++. I am using a
C++ function within wpp~.c.
The wavelet library uses an Interval class, which consists of an
indexed array of doubles (re-defined as real ) . So, I added a c++
function which is called by pd that takes an array of floats and an
integer by reference. This c++ function, createDWT, is called in
wpp~.c itself. createDWT simply copies the information into an
Interval, uses the WaveTrans function from the wave++ library and
copies the information back.
createDWT is separately compiled, and the ld command is then used to
link the program. The compiling and linking seem to work.....but when
pd loads up wpp~ the terminal says
Undefined symbol (_ZdaPv) (I have actually had several different
undefined symbols at different times).
The commands used for compiling and linking are as follows:
LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC
-Wall -W -Wshadow -Wstrict-prototypes
-Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
LINUXINCLUDE = -I../../src -Iwave++/source
.c.pd_linux: $(CC) $(LINUXINCLUDE) $(LINUXCFLAGS) -I../../src -o $*.o -c $*.c $(CC) $(LINUXINCLUDE) $(LINUXCFLAGS) -Iwave++/source -o createDWT.o -c createDWT.cc ld -export-dynamic -shared -Lwave++/source/ -L/usr/lib/gcc/i386-redhat-linux/3.4.3/ / -o wpp~.pd_linux wpp~.o createDWT.o -lc -lm -lw -lstdc++ rm -f $*.o
I have been using FC3, but I am currently upgrading to FC4 to see if it resolves this issue, like if the linker needs revision or something.
Also, if anyone knows an easier way to use wave++ or a wavelet transform in pd, please let me know.
-- Charles Zachary Henry
anti.dazed.med Med student who needs a Mickey's