# Error when linking WAM

**URL:** <https://iplug2.discourse.group/t/error-when-linking-wam/552>\
**Category:** Web Audio Modules\
**Created:** [23 January 2022 13:28 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552 "2022-01-23T13:28:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![olawistedt](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olawistedt/32/232_2.png) [@olawistedt](https://iplug2.discourse.group/u/olawistedt)\
**Post date:** [23 January 2022 13:28 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552/1 "2022-01-23T13:28:44Z")

</div>

I’m trying to build a Web audio module. It works fine to build as standalone and it also works fine to build if I left out the functions:  
OnParamChange(int paramIdx) override;  
void OnIdle() override;  
bool OnMessage(int msgTag, int ctrlTag, int dataSize, const void\* pData) override;  
but then I can’t control the synth.

I get these error messages when I try to build with the functions:

```auto
  error: undefined symbol: _ZN10BassMatrix13OnParamChangeEi (referenced by top-level compiled C/C++ code)
  warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols
  warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
  warning: __ZN10BassMatrix13OnParamChangeEi may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
  error: undefined symbol: _ZN10BassMatrix6OnIdleEv (referenced by top-level compiled C/C++ code)
  warning: __ZN10BassMatrix6OnIdleEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
  error: undefined symbol: _ZN10BassMatrix9OnMessageEiiiPKv (referenced by top-level compiled C/C++ code)
  warning: __ZN10BassMatrix9OnMessageEiiiPKv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
  Error: Aborting compilation due to previous errors
  emcc: error: '/home/runner/work/_temp/3f11d704-6a25-408d-bf25-3e8a43595fb5/emsdk-master/node/14.15.5_64bit/bin/node /home/runner/work/_temp/3f11d704-6a25-408d-bf25-3e8a43595fb5/emsdk-master/upstream/emscripten/src/compiler.js /tmp/tmpp2vtt720.txt' failed (1)
  make: *** [BassMatrix-wam-controller.mk:12: ../build-web/scripts/BassMatrix-web.js] Error 1
  emmake: error: 'make --makefile BassMatrix-wam-controller.mk EXTRA_CFLAGS=-DWEBSOCKET_CLIENT=0' failed (2)
  IPlugWEB WASM compilation failed
  Error: Process completed with exit code 1.

```

Maybe its I that implementing the functions wrong, but I have no idea how I should implement them another way.

For thoose who is curious. The web module so far looks and sounds like this `https://olawistedt.github.io/BassMatrix/`

---

<div class="post-metadata">

**Author:** ![olilarkin](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olilarkin/32/2_2.png) [@olilarkin](https://iplug2.discourse.group/u/olilarkin)\
**Post date:** [23 January 2022 16:09 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552/2 "2022-01-23T16:09:22Z")

</div>

You have missing symbols errors, which usually means that you didn’t include an implementation file (.cpp) in the build process. You probably need to add a .cpp file here to the WAM\_SRC line in the config/BassMatrix-web.mk, or if the cpp is required in both the DSP and EDITOR compilation stages, you can add it to SRC

> <https://github.com/iPlug2/iPlug2/blob/master/Examples/IPlugInstrument/config/IPlugInstrument-web.mk#L6>

> <https://github.com/iPlug2/iPlug2/blob/master/Examples/IPlugInstrument/config/IPlugInstrument-web.mk#L8>

---

<div class="post-metadata">

**Author:** ![olilarkin](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olilarkin/32/2_2.png) [@olilarkin](https://iplug2.discourse.group/u/olilarkin)\
**Post date:** [23 January 2022 16:13 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552/3 "2022-01-23T16:13:10Z")

</div>

> [@olawistedt](#):
>
> [BassMatrix WAM](https://olawistedt.github.io/BassMatrix/)

awesome! can’t wait to see how this develops! 🙂

---

<div class="post-metadata">

**Author:** ![olawistedt](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olawistedt/32/232_2.png) [@olawistedt](https://iplug2.discourse.group/u/olawistedt)\
**Post date:** [23 January 2022 19:41 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552/4 "2022-01-23T19:41:14Z")

</div>

Thanks!

What you wrote made me realize that there is a division between controller and processor. This was very clear when I dive into the make files.

Now the WAM is kind of an instrument one can play on, but the GUI is not showing the correct sequencer buttons.

---

<div class="post-metadata">

**Author:** ![olilarkin](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olilarkin/32/2_2.png) [@olilarkin](https://iplug2.discourse.group/u/olilarkin)\
**Post date:** [24 January 2022 22:04 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552/5 "2022-01-24T22:04:58Z")

</div>

@olawistedt let me know if you’d like some help fixing the layout issues… I can explain how you can customise the html a bit too.

---

<div class="post-metadata">

**Author:** ![olawistedt](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olawistedt/32/232_2.png) [@olawistedt](https://iplug2.discourse.group/u/olawistedt)\
**Post date:** [25 January 2022 13:29 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552/6 "2022-01-25T13:29:15Z")

</div>

I didn’t knew I had any layout issues. But now I see them 🙂

You are very welcome to fix this issues if you have the time and feel it would be fun. I have sent you an invitation to be a collaborator in the BassMatrix Github project.

---

<div class="post-metadata">

**Author:** ![olawistedt](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olawistedt/32/232_2.png) [@olawistedt](https://iplug2.discourse.group/u/olawistedt)\
**Post date:** [25 January 2022 20:56 UTC](https://iplug2.discourse.group/t/error-when-linking-wam/552/7 "2022-01-25T20:56:00Z")

</div>

@olilarkin I have tested your changes and it works fine! Thank you so much!
