[PD] my first external

martin.peach at sympatico.ca martin.peach at sympatico.ca
Tue Sep 4 20:47:09 CEST 2007


Atte André Jensen wrote:
> I took the code found here
http://iem.kug.ac.at/pd/externals-HOWTO/node3.html#SECTION00036000000000000000
> placed it in a file helloworld.c, but got:
> 
> atte at ajstrup:~/music/synth/pd/externals/atte$ gcc helloworld.c
> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function 
> `_start':
> ../sysdeps/i386/elf/start.S:115: undefined reference to `main'

Because you need to tell gcc to build a dynamic library instead of a standalone:
Add -export_dynamic and -shared to the command line
Also add -ohelloworld.pd_linux to get the correct output file name.
 
> /tmp/ccuN3zCm.o: In function `helloworld_bang':
> helloworld.c:(.text+0xe): undefined reference to `post'

You need to #include <m_pd.h> in the source file.
If you have #include "m_pd.h" then m_pd.h has to be in the same directory as the source file.

Martin






More information about the Pd-list mailing list