[PD] More help for a newbie?
Chad A. Wood
chad at sphericle.com
Thu Aug 14 21:13:32 CEST 2003
I've just recently gotten my first external to compile successfully in
VC++6. I can tell you things that tripped me up:
1) Make sure you start the project as an empty dll project.
2) Under Project Menu->Project Settings-> C/C++ tab: choose the preprocessor
category and under additional include directories, put the path to your pd
source directory, so that you can link to the m_pd.h file.
3) Under The link tab in the project settings, add pd.lib to the list of
library modules to link to. And, pick the "Input" category and put the path
to your pd bin directory (where pd.lib is) under additional library path
4) Make a file that is called <external name>.def, for instance i just made
a square wave generator and my def file is square~.def. You might know
about this, but I didn't and no one ever mentioned it to me. The def file
defines the functions that you are exporting so that pd can call them. You
need to export your setup function. E.g., for mine it was called
square_tilde_setup. The format of the def file is this:
LIBRARY <external name>
DESCRIPTION <a comment for describing your external if you want>
<setup function name> @1
so mine was:
DESCRIPTION module for making a square wave
If you need to export more functions, just put them in a list under exports,
one line at a time, with @2, @3, etc next to them. Oh, and the function
name should be just the name, no argument list, no parentheses. I learned
all of this from some random dll tutorial I found online for writing device
drivers. (Lost the URL).
Make sure you add this file to your project so that it will be used when the
dll is compiled. Otherwise, you'll get a compiled dll but when you try to
load it, pd will complain that it can't find your setup function.
I hope this makes sense. I was really frustrated when I first tried to make
externals on windows because I found very little help!
p.s. I'll try to come up with an empty project and workspace for making
externals in a day or two and post it online, now that I know how. Why
doesn't this exist already?!?!?!
> -----Original Message-----
> From: pd-list-admin at iem.at [mailto:pd-list-admin at iem.at]On Behalf Of
> Sent: Thursday, August 14, 2003 12:47 PM
> To: the PD list
> Subject: [PD] More help for a newbie?
> OK, so you werent so excited about my last email. Thats cool. Ive
> decided to write my own external to solve the problem, but Im
> getting problems. Ive never compiled a dll in microsquish visual
> c++ 6.0 before.
> Im trying to get the helloworld.c demo from the iem site to
> compile but I get unresolved linker errors. Can anyone make a
> workspace that has all the project settings correct or perhaps
> direct me towards my goal?
> Thank you for your time and patience.
> PD-list mailing list
> PD-list at iem.at
More information about the Pd-list