Hi to all,
Im trying to create my first "Hello world" external with this tutorial:
http://iem.kug.ac.at/pd/externals-HOWTO/pd-externals-HOWTO.pdf
How to save the file (what format) and how to load at puredata to see it works?
Javi
Javier GarcÃa wrote:
Hi to all,
Im trying to create my first "Hello world" external with this tutorial:
http://iem.kug.ac.at/pd/externals-HOWTO/pd-externals-HOWTO.pdf
How to save the file (what format) and how to load at puredata to see it works?
the format is a textfile, usually ending with .c (and not .txt) to load it into pd, you will have to compile it. you need a compiler for this. this is not covered by the howto, since compiling is heavily system dependent (and if you know enough C to follow the example, you should be able to compile).
for examples on how to compile an external, have a look into the makefiles of the externals that come with pd (e.g. doc/6.externs/ or /extra/*/) or have a look at one of the externals in the CVS at sourceforge (there is a webbrowser at http://pure-data.cvs.sourceforge.net/pure-data/externals/)
m,fgasdr IOhannes
Javi
On Wed, 30 Aug 2006, Javier García wrote:
Im trying to create my first "Hello world" external with this tutorial: http://iem.kug.ac.at/pd/externals-HOWTO/pd-externals-HOWTO.pdf How to save the file (what format) and how to load at puredata to see it works?
save it as helloworld.c and translate it to an executable with a command like this:
gcc -shared -o helloworld.pd_linux helloworld.c
if you're on a mac, do it like this instead:
gcc -bundle -undefined suppress -o helloworld.pd_darwin helloworld.c
if your text editor doesn't want to deal with .c files, you could save as helloworld.txt and replace helloworld.c by -xc helloworld.txt in the commands above. (You need to have "gcc" of course).
if you're on windows instead, i can't help you.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Thanks, so after compiling i will have an exe file (for example in windows). But what i have to do to use it at puredata? Will it be a puredata object like [print] for example, that prints "Hello world?"
From: Mathieu Bouchard matju@artengine.ca To: Javier GarcÃa tirengarfio@hotmail.com CC: PD-list@iem.at Subject: Re: [PD] Hello world external Date: Wed, 30 Aug 2006 23:00:47 -0400 (EDT)
On Wed, 30 Aug 2006, Javier GarcÃa wrote:
Im trying to create my first "Hello world" external with this tutorial: http://iem.kug.ac.at/pd/externals-HOWTO/pd-externals-HOWTO.pdf How to save the file (what format) and how to load at puredata to see it works?
save it as helloworld.c and translate it to an executable with a command like this:
gcc -shared -o helloworld.pd_linux helloworld.c
if you're on a mac, do it like this instead:
gcc -bundle -undefined suppress -o helloworld.pd_darwin helloworld.c
if your text editor doesn't want to deal with .c files, you could save as helloworld.txt and replace helloworld.c by -xc helloworld.txt in the commands above. (You need to have "gcc" of course).
if you're on windows instead, i can't help you.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Javier GarcÃa wrote:
Thanks, so after compiling i will have an exe file (for example in
no you don't. you have to compile the code into a dynamic library (e.g. ".dll" on w32)
windows). But what i have to do to use it at puredata? Will it be a puredata object like [print] for example, that prints "Hello world?"
yes, this is the point of externals.
however, i am sure you don't need to write an external if you don't know what an external is. (this is nothing bad, since most things _can_ be done with plain Pd; in the past there has been some mystification, that you need to write your externals to be a real pd-er; this is nonsense)
mfg.asdr. IOhannes
Thanks, so after compiling i will have an exe file (for example in windows). But what i have to do to use it at puredata? Will it be a puredata object like [print] for example, that prints "Hello world?"
no, you must end up with a .dll file. you can use the makefile in pd\doc\6.externs you just have to modify line 8 with the actual external name line 13 for your VC path line 15: edit PDNTINCLUDE putting your pd path line 21: put the correct path to pd.lib
when you have that dll you will have a puredata object, put it into the extra folder (or keep it in your working directory) and you'll be able to use it.
ciao, davide.
Mathieu Bouchard a écrit :
if your text editor doesn't want to deal with .c files, you could save as helloworld.txt and replace helloworld.c by -xc helloworld.txt in the commands above. (You need to have "gcc" of course).
if you're on windows instead, i can't help you.
If you are on windows, read this:
http://www.mingw.org/docs.shtml
___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com