[PD] undefined symbol

Alexandros adrcki at gmail.com
Mon Nov 7 13:08:33 CET 2022

On 7/11/22 13:16, IOhannes m zmoelnig wrote:
> On 11/7/22 10:13, Alexandros wrote:
>> I'm trying to make an external with the source being split in five 
>> files, where all are included in the main file that creates the 
>> object. This is someone else's code (given freely), not aimed at Pd, 
>> and I would like to maintain this structure, rather than write 
>> everything in the main file.
>> I'm using pdlibbuilder's Makefile and the compilation process 
>> succeeds with a few warnings about unused parameters, but when I try 
>> to create the object in Pd, I get the following error:
>> undefined symbol: set_char_to_indx
>> set_char_to_indx is a function defined in one of the files included 
>> in the main file and it is used in one place in the main file. How 
>> can it be solved?
> hard to tell without more info.
> if you write "included in the main file", what exactly does this mean?
> is it only the header-file you are "#include"ing?
> if so, you must also compile the C file where 'set_char_to_indx' is 
> implemented and then link it into the final binary (external).
> the simplest way to do that is using pd-lib-builders 'common.sources' 
> variable (which will statically link the given files to all externals 
> built by the project).

That was it! Thanks! For documentation, I wrote the following in Makefile:

common.sources = lstm_.c set.c layers.c utilities.c

Now the object loads. Thanks.

> gfmadsr
> IOhannes
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list

More information about the Pd-list mailing list