<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>
      <blockquote type="cite">it seems that the espeak.pd_linux is not
        linked at all against the libespeak library.
      </blockquote>
      Ha, good catch!<br>
    </p>
    <p>As a side note for other people:<br>
    </p>
    <p>By default, ld doesn't complain about missing symbols during
      linkage when building a shared library, instead you get an error
      at load time (which is what has happened here). You would have to
      pass "-Wl,--no-undefined" to get the error already at link time.
      However, you can't really do that with Pd externals, because they
      don't actually link back to Pd (instead they rely on
      "-export-dynamic" to get the symbols from the host executable
      itself) and "-Wl,--no-undefined" would give you errors for all Pd
      symbols.</p>
    <p>On Windows, however, the linker always tries to resolve all
      symbols, generally by using so called import libraries (although
      MinGW can also directly link against DLLs). If a symbol is not
      found, you get a linker error. That's also why on Windows we need
      a pd.dll + pd.lib, otherwise externals wouldn't have anything they
      can actually link back to.</p>
    <p>Christof<br>
    </p>
    <div class="moz-cite-prefix">On 13.03.2021 23:04, IOhannes m zmölnig
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:22197603-12a3-3a05-7616-7053ca553ba8@iem.at">On 3/13/21
      10:45 PM, Christof Ressi wrote:
      <br>
      <blockquote type="cite">
        <blockquote type="cite">
          <br>
        </blockquote>
        So the actual problem is that Pd can't find the 'espeak' library
        at runtime. You obviously have it installed, at least gcc can
        find the header files during compilation.
        <br>
      </blockquote>
      <br>
      the *actual* problem is, that one (or more) symbol(s) that are
      supposed to be provided by the libespeak library cannot be
      resolved.
      <br>
      there's no error indicating that any library cannot be found at
      runtime.
      <br>
      <br>
      i just checked the project and after a successfull compilation, it
      seems that the espeak.pd_linux is not linked at all against the
      libespeak library.
      <br>
      <br>
      this basically indicates a broken build system.
      <br>
      whenever you happen to meet the author of the makefile, please
      deliver a good slapping from my side.
      <br>
      <br>
      <br>
      what is going wrong here, is that modern linkers try aggressively
      to remove unneeded dependencies. and because libespeak is added to
      the linker when nothing yet uses any of its symbols, it is
      discarded.
      <br>
      <br>
      putting the linker-flags to pull in the libraries after the
      object-files that require these libraries, fixes the problem:
      <br>
      <br>
      <br>
      ```
      <br>
      $ git diff Makefile
      <br>
      diff --git a/Makefile b/Makefile
      <br>
      index b3528b2..cd5b0ce 100644
      <br>
      --- a/Makefile
      <br>
      +++ b/Makefile
      <br>
      @@ -63,7 +63,7 @@ TARGETS=$(SOURCES:.c=.$(EXTENSION))
      <br>
       pd_linux: $(TARGETS)
      <br>
      <br>
       LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC
      \
      <br>
      -    -Wall -W -Wshadow -Wstrict-prototypes -Werror \
      <br>
      +    -Wall -W -Wshadow -Wstrict-prototypes  \
      <br>
           -Wno-unused -Wno-parentheses -Wno-switch
      <br>
      <br>
       LINUXLDFLAGS =  -export-dynamic -shared  -lc -lm -lespeak
      <br>
      @@ -71,7 +71,7 @@ LINUXLDFLAGS =  -export-dynamic -shared  -lc -lm
      -lespeak
      <br>
       LINUXINCLUDE =  -I$(PDSRCDIR)
      <br>
      <br>
       %.pd_linux: %.c
      <br>
      -       $(CC) $(LINUXLDFLAGS) $(LINUXCFLAGS) $(LINUXINCLUDE) -o
      $*.pd_linux $*.c
      <br>
      +       $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c
      $(LINUXLDFLAGS)
      <br>
              strip --strip-unneeded $*.pd_linux
      <br>
      <br>
      <br>
      ```
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a>
</pre>
    </blockquote>
  </body>
</html>