[PD] externals tutorial: link error

IOhannes m zmölnig zmoelnig at iem.at
Sat Feb 19 11:51:49 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/18/2011 11:04 PM, Elliott Slaughter wrote:
> 
> Thanks. The MSW fix worked. Funny that m_pd.h can't figure that out
> automatically....

???
m_pd.h is a file that cannot do anything on it's own.

also, this file is only used during the compilation stage, whereas your
problem comes from the linker stage.

linking on windows is usually very restrictive, in that it requires the
developer to explicitely define what they want to export (when writing
dllS) or what they want to import (when using dllS)

this requirement obviously counteracts the idea of "m_pd.h" (or anything
else) to _automatically_ figure it out.

two more things:
- - when using __declspec() you should _always_ use MACROs, in order to
make porting (and maintainance) easiert. look at the "EXTERN" definition
in m_pd.h how Pd does this.

- - you can also tell the linker directly which symbols you want to
export. e.g, using M$VC's you can add a linker flag like
"/export:foo_setup", which will make the "foo_setup" function accessible
by Pd.

fgmadr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1foMUACgkQkX2Xpv6ydvQGfACgybLPfdw/Vq02JJzP6nf2Xi7T
R2oAoJfdc14q+H3H+wFPSNXnl+7jDmbR
=dkPM
-----END PGP SIGNATURE-----



More information about the Pd-list mailing list