<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,<br>
</p>
<p>here's the explanation:
<a class="moz-txt-link-freetext" href="https://github.com/pure-data/pd-lib-builder/blob/e6cff665a3a30a967c72c382c6fe92bcdedd7b44/Makefile.pdlibbuilder#L45">https://github.com/pure-data/pd-lib-builder/blob/e6cff665a3a30a967c72c382c6fe92bcdedd7b44/Makefile.pdlibbuilder#L45</a></p>
<p>"class.sources" assumes one source per class. What you need is "<span
class="pl-c"><classname>.class.sources", i.e.
"s4pd.class.sources = </span><span class="pl-c">s4pd.c s7.c"<br>
</span></p>
<p><span class="pl-c">"common.sources" would have worked too, you
just made a typo ;-) However, I think the solution above is
clearer, as "common.sources" is really meant for the case where
you have *multiple* classes with same shared code.<br>
</span></p>
<p>Christof<br>
</p>
<div class="moz-cite-prefix">On 27.10.2020 23:44, Iain Duncan wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAN9NcLxxtcVORuvkbf6Ha=KVBsuG0s1iDaOaSwLMZDep7V4-HA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi devs, I'm trying to get pd-lib-builder working,
but I think my lack of C building experience has me stuck. I was
able to get my empty helloworld working ok, but not managing to
link in S7.
<div><br>
</div>
<div>My project has one C file, and needs to also include s7.h
and build s7.c I've included my (not working) Makefile below.
When I try the below s7 does get compiled, producing an s7.o
file, but instead of static linking I get an s7.pd_darwin file
with all of the S7 stuff (it's big) and a tiny s4pd.pd_darwin
file. And the external tries to load an s7 function and fails.
Any tips much appreciated!
<div><br>
</div>
<div>thanks,</div>
<div>Iain</div>
<div><br>
</div>
<div>My Makefile:</div>
<div><br>
</div>
<div># library name<br>
<a href="http://lib.name" moz-do-not-send="true">lib.name</a>
= s4pd<br>
<br>
# tried these too, to no avail<br>
#lib.setup.sources = s7.c<br>
#common.source = s7.c<br>
<br>
# input source file (class name == source file basename)<br>
class.sources = s4pd.c s7.c<br>
<br>
# all extra files to be included in binary distribution of
the library<br>
datafiles = README.md<br>
<br>
# include Makefile.pdlibbuilder from submodule directory
'pd-lib-builder'<br>
PDLIBBUILDER_DIR=pd-lib-builder/<br>
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder<br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Pd-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pd-dev@lists.iem.at">Pd-dev@lists.iem.at</a>
<a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a>
</pre>
</blockquote>
</body>
</html>