I just put together some pieces of Pd's source code to make an external, and even though it compiles without a problem (using Katja's Makefile.pdlibbuilder), Pd just can't load it. Using verbose mode I see that Pd tries a bunch of directories, and even though this line is included:
tried /home/alexandros/Documents/Pd/externals/sync_phasor~/sync_phasor~.pd_linux and succeeded
Pd keeps on trying to find it, and there are more failure lines after that and eventually the object can't be created. How can I solve this?
I'm on Ubuntustudio 17.10 with Pd-0.48-0
(on top of my head) even when an executable is found by pd, some things can still go wrong;
If a (function) symbol is not found, I think that pd would mention that in verbose mode. Is there no relevant warning at all?
Katja
On Mon, Dec 25, 2017 at 10:32 PM, Alexandros adrcki@gmail.com wrote:
I just put together some pieces of Pd's source code to make an external, and even though it compiles without a problem (using Katja's Makefile.pdlibbuilder), Pd just can't load it. Using verbose mode I see that Pd tries a bunch of directories, and even though this line is included:
tried /home/alexandros/Documents/Pd/externals/sync_phasor~/sync_phasor~.pd_linux and succeeded
Pd keeps on trying to find it, and there are more failure lines after that and eventually the object can't be created. How can I solve this?
I'm on Ubuntustudio 17.10 with Pd-0.48-0
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
2017-12-25 20:00 GMT-02:00 katja katjavetter@gmail.com:
(on top of my head) even when an executable is found by pd, some things can still go wrong;
- a symbol is not found
- required arguments aren't supplied
If a (function) symbol is not found, I think that pd would mention that in verbose mode. Is there no relevant warning at all?
I guess that warning would come from Log: debug (3) or all (4), right?
On 26/12/2017 12:00 πμ, katja wrote:
(on top of my head) even when an executable is found by pd, some things can still go wrong;
- a symbol is not found
- required arguments aren't supplied
If a (function) symbol is not found, I think that pd would mention that in verbose mode. Is there no relevant warning at all?
In verbose mode and Log: 4 I get this after the success line: load_object: Symbol "sync_phasor_tilde_setup" not found
There is a sync_phasor_tilde_setup() method in my code though. It's this:
void sync_phasor_tilde_setup(void) { sync_phasor_tilde_class = class_new(gensym("sync_phasor~"), (t_newmethod)sync_phasor_tilde_new, (t_method)sync_phasor_tilde_free, sizeof(t_sync_phasor_tilde), 0, A_DEFFLOAT, 0); class_addmethod(sync_phasor_tilde_class, (t_method)sync_phasor_tilde_dsp, gensym("dsp"), A_CANT, 0); CLASS_MAINSIGNALIN(sync_phasor_tilde_class, t_sync_phasor_tilde, x_f); }
On 26/12/17 16:33, Alexandros wrote:
load_object: Symbol "sync_phasor_tilde_setup" not found
There is a sync_phasor_tilde_setup() method in my code though. It's this:
void sync_phasor_tilde_setup(void)
Maybe this should be:
extern void sync_phasor_tilde_setup(void)
For Windows there may be other incantations necessary (?), but for your Linux it should be enough, if indeed the missing extern is the problem.
On 26/12/2017 06:40 μμ, Claude Heiland-Allen wrote:
On 26/12/17 16:33, Alexandros wrote:
load_object: Symbol "sync_phasor_tilde_setup" not found
There is a sync_phasor_tilde_setup() method in my code though. It's this:
void sync_phasor_tilde_setup(void)
Maybe this should be:
extern void sync_phasor_tilde_setup(void)
That did it! It's the first time I'm trying to write an external in Ubuntustudio. I wrote before in Debian and Mac, and never needed to add extern. Any ideas why is that? If I want to share this external, should I keep the extern or not?
Thanks
this strikes me as odd. in C, funtion declarations/definitions are extern by default, i.e. there shouldn't be any difference between void foo(void) { ... } and extern void foo(void) {...}
in fact, I haven't seen a single Pd external source file where the setup function was explicitly marked 'extern'.
could it be that your setup function was accidentally marked as 'static'? how did you build your external?
Gesendet: Dienstag, 26. Dezember 2017 um 17:49 Uhr Von: Alexandros adrcki@gmail.com An: pd-list@lists.iem.at Betreff: Re: [PD] Can't load external I put together and want to test
On 26/12/2017 06:40 μμ, Claude Heiland-Allen wrote:
On 26/12/17 16:33, Alexandros wrote:
load_object: Symbol "sync_phasor_tilde_setup" not found
There is a sync_phasor_tilde_setup() method in my code though. It's this:
void sync_phasor_tilde_setup(void)
Maybe this should be:
extern void sync_phasor_tilde_setup(void)
That did it! It's the first time I'm trying to write an external in Ubuntustudio. I wrote before in Debian and Mac, and never needed to add extern. Any ideas why is that? If I want to share this external, should I keep the extern or not?
Thanks
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 12/27/2017 07:05 PM, Christof Ressi wrote:
this strikes me as odd. in C, funtion declarations/definitions are extern by default, i.e. there shouldn't be any difference between void foo(void) { ... } and extern void foo(void) {...}
in fact, I haven't seen a single Pd external source file where the setup function was explicitly marked 'extern'.
could it be that your setup function was accidentally marked as 'static'? how did you build your external?
more likely, your compiler/linker defaults to not exporting any symbols that are not explicitely eported. reading the changelog and README.Debian that comes with your compiler docs (look out for /usr/share/doc/gcc*/) might help.
gfamdsr IOhannes
On Wed, Dec 27, 2017 at 7:52 PM, IOhannes m zmölnig zmoelnig@iem.at wrote:
On 12/27/2017 07:05 PM, Christof Ressi wrote:
this strikes me as odd. in C, funtion declarations/definitions are extern by default, i.e. there shouldn't be any difference between void foo(void) { ... } and extern void foo(void) {...}
in fact, I haven't seen a single Pd external source file where the setup function was explicitly marked 'extern'.
could it be that your setup function was accidentally marked as 'static'? how did you build your external?
more likely, your compiler/linker defaults to not exporting any symbols that are not explicitely eported. reading the changelog and README.Debian that comes with your compiler docs (look out for /usr/share/doc/gcc*/) might help.
When a makefile or environment specifies ld flag -visibility=hidden, gcc does not export symbols except those declared with "__attribute__((visibility("default")))" (on Linux / OSX) or "__declspec(dllexport)" (on Windows). (https://gcc.gnu.org/wiki/Visibility, this doc is about C++ but it works the same for C). Such attributes should be used for the setup function of a Pd external in that case. I haven't found any docs saying that explicit "extern" can serve a similar purpose of overriding a visibility setting or default.
Katja
gfamdsr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list