[PD] Using externals with libpd on Windows
white.joe4 at gmail.com
Fri May 18 17:38:47 CEST 2018
Thanks for the info Christof!
It seems to me that compiling libpd via the makefile  in mingw already
exports all the symbols correctly.
Seems like the solution in your link  suggests to export the symbols in
the exe, and also update the plugins to load the functions via
GetProcAddress. I'm trying to avoid touching the 3rd party externals if
possible as I can already re-link them against the libpd.dll but don't feel
that is very maintainable.
Has anyone managed to successfully load pre-compiled externals in a
libpd-embedded Windows application?
I'm currently trying to see if it's possible to point the externals to the
find the pd symbols elsewhere as they get loaded, but my hopes aren't high!
On 11 May 2018 at 20:04, Christof Ressi <christof.ressi at gmx.at> wrote:
> yes, this is a limitation on windows where a DLL can't automatically
> import symbols from the executable where it was loaded (what you get on
> Linux with --export-dynamic). for Pd the solution is to make the app itself
> a thin wrapper around a DLL (pd.dll) which plugins can link to.
> I found this link which might be helpful:
> I guess if you compile libpd as a DLL (with "--export-all-symbols")
> existing externals should load.
> Gesendet: Freitag, 11. Mai 2018 um 19:21 Uhr
> Von: "Joe White" <white.joe4 at gmail.com>
> An: Pd-list <pd-list at lists.iem.at>
> Betreff: [PD] Using externals with libpd on Windows
> Hi all,
> I recently spent a bit of time tracking down why a patch wasn't loading a
> couple of externals in a windows application that embeds libpd.
> The patch was using vbap  and soundfile_info from iemlib .
> The issue I found was that the pre-built binaries that work in the window
> version of the Pd authoring environment were linking against pd.dll (I'm
> assuming from Pd/bin/) in order to correctly link against the plugin API
> methods exposed in m_pd.h.
> The solution I recently came to, though admittedly a bit of a hack, was to
> generate a custom VS2017 dll project for both vbap, and soundfile_info,
> include the relevant source files, and link against the compiled version of
> libpd to resolve the missing symbols instead of the authoring libraries.
> The downside of this approach is that the manually compiled externals will
> no longer run in the Pd authoring environment, and it's not really
> maintainable from a development perspective.
> From my days of making externals for macos, I don't think I ever had to
> link against Pd, but just include m_pd.h and be done.
> My question is whether this is usual behaviour when working with
> externals/libpd on Windows or if I'm missing something somewhere?
> Any perspective would be much appreciated!
>  https://puredata.info/downloads/vbap
>  https://git.iem.at/pd/iemlib[https://git.iem.at/pd/
> Pd-list at lists.iem.at mailing list UNSUBSCRIBE and account-management ->
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pd-list