Symbol not found when attempting to load v2 plugin after building for dist

My plugin builds and is available if I build Rack v2 myself:

make plugins; make run;

But when I build my plugin for distribution and install it into the dev build VCV-Rack-2-042a9ce0.app:

export RACK_DIR=/Users/adammalone/Rack2/sdk/Rack-SDK-2.git.042a9ce0-mac/;
make dist;
make install;

My plugin does not load. I am sure that I’m using build 042a9ce0 of both Rack and the SDK. I have also confirmed that the computerscare-2.0.0-mac.vcvplugin file is placed in the correct plugins/ directory. Here is the error message in log.txt:

[0.095 info src/plugin.cpp:108 loadPlugin] Loading plugin from /Users/adammalone/Documents/Rack2/plugins/computerscare
[0.343 warn src/plugin.cpp:161 loadPlugin] Could not load plugin /Users/adammalone/Documents/Rack2/plugins/computerscare: Failed to load library /Users/adammalone/Documents/Rack2/plugins/computerscare/plugin.dylib: dlopen(/Users/adammalone/Documents/Rack2/plugins/computerscare/plugin.dylib, 6): Symbol not found: __ZN4rack3app11LightWidget9drawLayerERKNS_6widget6Widget8DrawArgsEi
  Referenced from: /Users/adammalone/Documents/Rack2/plugins/computerscare/plugin.dylib
  Expected in: /Users/adammalone/Documents/Rack2/VCV-Rack-2-042a9ce0.app/Contents/MacOS/../Resources/libRack.dylib
 in /Users/adammalone/Documents/Rack2/plugins/computerscare/plugin.dylib

Usually when I’ve seen something like this I run the debugger, but I don’t know how to do that unless I’m building Rack myself. Any ideas? Thanks in advance!

Someone had this problem the other day - I think it may help to make a ‘plugins’ folder inside the Rack Rack-SDK directory. Put your plugin folder in there, cd <your plugin>, then make dist.

Or if you are using Rack built from source, just make a ‘plugins’ folder in your Rack directory and do the same thing.

1 Like

Always recommended! It’s easy, and you always have the source there to look at.

2 Likes

I started my port using that version of rack2 and the SDK. But I found that it did not contain the drawLayer method. drawLayer was added quite recently, and replaces the original method for light widgets.

So I gave up on the SDK and went with building from source, although that’s more risky for now.

I’m not sure how you got it to compile, but it sounds like your Rack2 executable predates the change to the drawLayer technique.

1 Like

Things are working now with the new sdk and Rack build 2.git.219bbaf1

I think this topic can be deleted (@rsmus7 or @pgatt maybe?), it would probably only confuse a future forum searcher