[PD] undefined symbol after compiling and linking an external

Georg Holzmann grhPD at gmx.at
Wed Oct 12 23:23:08 CEST 2005


Hallo!

If you want to make an external in C++ you have (at least) 2 options:

- you have to declare the setup function as extern "C"
   (see the thread 
http://lists.puredata.info/pipermail/pd-dev/2004-08/002583.html)

- or you can use flext (see http://grrrr.org/ext/flext/)


but I'm not sure if that was really your question ...

LG
Georg




Charles Henry wrote:
> 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
> 
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> 
> 


-- 
=%)!:?"§<§0&-"|>*
http://grh.mur.at




More information about the Pd-list mailing list