Stuck on silly linker error compiling external with buffer operations

    Jan 20 2021 | 9:54 pm
    Hi folks, I know I figured this out before, but can't remember how and am not finding previous posts with search. I started a new external from UI example, copy the xcode project. Now I've added buffer functions, and I'm getting linker errors. I'm my includes are: #include "ext.h" #include "ext_obex.h" #include "jgraphics.h" #include "ext_buffer.h" #include "ext_common.h" #include "ext_obex_util.h"
    I'm getting the errors below. Does anyone know what the step I'm missing might be?
    thanks! errors:
    Undefined symbols for architecture x86_64:
    "_buffer_getframecount", referenced from:
    _xtmgrid_read_buffer in xtm.grid.o
    "_buffer_locksamples", referenced from:
    _xtmgrid_read_buffer in xtm.grid.o
    "_buffer_ref_getobject", referenced from:
    _xtmgrid_read_buffer in xtm.grid.o
    "_buffer_ref_new", referenced from:
    _xtmgrid_read_buffer in xtm.grid.o
    "_buffer_unlocksamples", referenced from:
    _xtmgrid_read_buffer in xtm.grid.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    • Jan 20 2021 | 10:04 pm
      Hi Iain, I hope someday I will get to know you in person. I am becoming a fan of yours...
      Generally when I get errors like these it's because I forgot to link against the MaxAudioAPI library. Very rarely it could also depend on the inclusion order of my header files. Lastly, I think you should try to include z_dsp.h.
    • Jan 21 2021 | 12:52 am
      Thanks Luigi! I hope one day we get to all hang at computer music conferences again... sure would be nice to meet people.
      I got it solved, but only in classic cargo cult style - banged my head on my desk for a while and then just copied over a working xcodeproject from my main external and stepped through it replacing everything. One of these days I really need to learn xcode properly, but it's way down the list of pressing concerns 99% of the time! Thanks for the tips again though. :-)
    • Jan 21 2021 | 12:58 am
      And Luigi, I should say that you have been the one who got me unstuck probably dozens of times on this journey, whether in real time or in searching the archives for helpful SDK answers. So thanks again!!